class animal(object):
pass dog=animal()cat=animal()
dog.name="xiaohuang"
dog.age='1'
cat.name='xiaohua'
cat.age='1.5'
print (dog.name)
print (dog.age)
print (cat.name)
print (cat.age)
class animal(object): pass dog=animal() cat=animal() dog.name="xiaohuang" dog.age='1' cat.name='xiaohua' cat.age='1.5' print (dog.name) print (dog.age) print (cat.name) print (cat.age)
class animal(object): pass dog=animal()cat=animal()dog.name="xiaohuang"dog.age='1'cat.name='xiaohua'cat.age='1.5'print (dog.name)print (dog.age)print (cat.name)print (cat.age)
print后面有空格
print(dog.name) print(dog.age) print(cat.name)