第十七天 ,面向对象编程
- 面向对象编程
https://www.cnblogs.com/wupeiqi/p/4493506.html
面向对象
一、 定义
函数:
def +函数名
面向对象:
class 名字叫Bar类
def +方法名
self
二、执行
面向对象
o=Bar() 创建中间人,对象,实例
o.foo()
定义类并执行类中的方法
class 类名:
def 方法名(self,arg)
print(arg)
中间人=类名()
中间人.方法名(1)
self代指调用的方法对象,中间人

浙公网安备 33010602011771号