# Class definition class Animal(object): """Makes cute animals.""" # For initializing our instance objects def __init__(self, name, age, is_hungry): self.name = name self.age = age self.is_hungry = is_hungry # Note that self is only used in the __init__() # function definition; we don't need to pass it # to our instance objects. zebra = Animal("Jeffrey", 2, True) giraffe = Animal("Bruce", 1, False) panda = Animal("Chad", 7, True) print zebra.name, zebra.age, zebra.is_hungry print giraffe.name, giraffe.age, giraffe.is_hungry print panda.name, panda.age, panda.is_hungry
I have this as my code but it keeps on saying “Did you add the is_hungry attribute to init()?”, which I have. I am very confused and am starting to get a bit frustrated as I can’t continue even though I think I’m doing it correctly.
Could anyone help?