import time
class Person:
country = ‘China‘ 类方法公共方法
def __init__(self,name,sex):
#构造函数,
# print(‘self的内存地址,‘,id(self))
self.name = name
self.sex = sex
ces=Person(‘ces‘,‘123‘)
print(ces.country)
ces=Person(‘ces‘,‘123‘)
ces.country=‘dssd‘ 类变量的修改值的方法
print(ces.country)
类方法
原文:https://www.cnblogs.com/weilemeizi/p/14536151.html