hi evryone :) in the "They're Multiplying!" exercise, I wrote down this code: ''' class Animal(object): """Makes cute animals.""" is_alive = True health = "good" def __init__(self, name, age): self.name = name self.age = age self.health = health def description(self): print self.name print self.age hippo = Animal("David", 12) sloth = Animal('Ben', 14) ocelot = Animal('Dan', 0.5) print hippo.health print sloth.health print ocelot.health '''' and got the following error: Traceback (most recent call last): File "python", line 12, in <module> File "python", line 8, in __init__ NameError: global name 'health' is not defined also, i got this massege: Oops, try again. Did you create an Animal() called sloth? what have I done wrong ? thank you in advance :)
self.health = health
remove it, you don't have to initialize member variables
thank you very much !