python类 & 对象风格

python对象风格object & 类class学习笔记 类class 一般类的创建 # 创建类 class Foo: def bar(self): #self必填 print('Bar') def hello(self, name): print('I am %s' % name) # 实例化 obj = Foo() obj.bar obj.hello('zzw') # 创建类 class F
相关文章
相关标签/搜索