0. 标题
Python专家编程系列: 6. OOP编程介绍
id:5
作者: [email protected]
blog: https://blog.csdn.net/quant_galaxy
1. 什么是OOP
Object-oriented programming (OOP)
面向对象编程(OOP)是一种编程范例,它使用对象(Object)和类(Class)来构建和组织代码。
在Python中,OOP概念是基本的概念,它允许你方便的创建可重用的代码。
2. 类 Class
类是创建对象的基础。
类定义了属性(data),方法(function),这些是构成类的基本元素。
class Car:
def __init__(