# class Critter(object): '''A virtual pet''' def __init__(self): print 'A new critter has been born!' def talk(self): print '/nHi. I'm an instance of class Critter.' # main crit1 = Critter() crit2 = Critter() crit1.talk() crit2.talk()
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/8220.html