Python——类操作1
class Dog: def __init__(self,name): self.name=name def bulk(self): print ("%s:wang wang wang!" % self.name) d1=Dog("小狗1") d2=Dog("小狗2") d1.bulk() d2.bulk()
class Dog: def __init__(self,name): self.name=name def bulk(self): print ("%s:wang wang wang!" % self.name) d1=Dog("小狗1") d2=Dog("小狗2") d1.bulk() d2.bulk()