They're multiplying -


Oops, try again. Make sure to give your Animal class a health member variable.

Is health not a member variable in my code ?

class Animal(object):
    """Makes cute animals."""
    is_alive = True
    health = "good"
    def __init__(self, name, age): = name
        self.age = age
    def description(self):
        print self.age
    hippo = Animal("hippo",12)
    sloth = Animal("geraldine the great",7)
    ocelot = Animal("Catfish",9)


Indentation is very important in python,Make sure that last 8 lines of code are on 0-indentation.


health is a member variable, but the problem are your class instance (hippo, sloth, ocelot) they should be created outside/after the class

like @greentreemee says, indention is the key here


sorted - I see my mistake now

Thank you both!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.