标签:birt print def 属性 self python int highlight 对象
class Person:
def __init__(self, name, id, gender, birth):
self.name = name # 实例变量 对象里的变量
self.id = id
self.gender = gender
self.birth = birth
p = Person("wusir", "10086", "不详", "1900-12-15")
print(p.birth)
p.birth = "1840-5-6"
print(p.birth)
# 实例变量一般使用 对象.属性
print(p.name)
标签:birt print def 属性 self python int highlight 对象
原文地址:https://www.cnblogs.com/work14/p/10145404.html