8. A Methodical approach


#1

My code:

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
hippo.description()

I even put hippo.description(Animal) earlier and that didn't work.
Error: Traceback (most recent call last):
File "python", line 12, in
AttributeError: type object 'Animal' has no attribute 'description'

Need help.


#2

HI you should finish the instance here

hippo = Animal

And your function description should be inside the class Animal


#3

What do you mean by that.


#4

you should creat a instance like that

hippo = Animal("Hola", 58);

and for the function decription it should...

class Animale
    def Im_inside_the_class_Animal(self):

def Im_outside_the_class_Animal

inside the class Animal


#5

I think it was a indentation problem


#6

HI did you pass it..?