class Dog(object):
def __init__(self,name):
self.name = name
print('这是dog的init')
def introduce(self):
print('介绍狗')
#创建对象
dog1 = Dog(‘小白’)
#动态增加实例属性
dog1.leg = 4
print(‘这只狗的名字’,dog1.name)
print(‘这只狗的腿’,dog1.leg)
print(’#############’)
dog1.introduce()