What is wrong here?



Oops, try again. It seems like your code raises an error, see the console window for the error message!
Traceback (most recent call last):
File "python", line 12, in
AttributeError: 'Animal' object has no attribute 'description'

class Animal(object):
    """Makes cute animals."""
    is_alive = True
    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("Harry", 18)


Hi the description method should be inside the class Animal


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