A methodical Approach


#1



https://www.codecademy.com/courses/python-intermediate-en-WL8e4/1/3?curriculum_id=4f89dab3d788890003000096#


File "python", line 13, in
TypeError: description() takes exactly 3 arguments (1 given)


I don't understand why it isn't working.


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, name, age):
        print self.name
        print self.age

hippo = Animal("bob", 20)
hippo.description()


#2

def description(self, name, age):

hint**
Your description() method only needs self parameter?


#3

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