self参数:
方法的分类:1.绑定类方法 2.非绑定类方法
class Sport():
head=1
legs=2
def run(self): #self代表的是对象本身
# print(self)
print(self.legs,‘跑起来跟飘了似得‘) #动态
print(Sport.legs,‘跑起来跟飘了似得‘) #静态
berte=Sport()
berte.legs=1
berte.run()
# print(‘==================‘)
# Sport.run(1)
原文:https://www.cnblogs.com/szc-boke/p/11281761.html