class Animal(object): """Makes cute animals.""" is_alive = True health = "good" def __init__(self, name, age): self.name = name self.age = age # Add your method here! def description(self): print self.name print self.age hippo = Animal("Jones", 13) Sloth = Animal("Harish", 4) Ocelot = Animal("Lanny", 9) print hippo.health print Sloth.health print Ocelot.health
I thought this was correct but NameError to Animal not being defined kept showing. So I asked for solution and compared the whole thing. My answer is word to word the solution and still I get “good” only for hippo. It tells me that ‘Sloth’ is not defined. Is this a bug?
Also something weird I noticed in my absolute last bit of code is that if I don’t press spacebar after < print hippo.health > the ‘print’ command in the next line appears blue. What is this for?