Methodical Approach


#1

Below is my code from exercise 8, Methodical Approach.
When submitted, i get the error:

Traceback (most recent call last):
File "python", line 13, in
TypeError: object.new() takes no parameters

What does this mean/what am i doing wrong???

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("Ele",12)
hippo.description()

#2

Hi this line

def init(self, name, age):

you should put init like that

def __init__(self,..)

#3

Thank you!! I though I might've been doing something stupid!


#4

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