A methodical approach


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("jack", 11)


what is wrong here?


Please show us the error, and your code with the indentation so we know that that's not the issue.

Based on a glance though, I think you need to change this:

def init(self, name, age)

To this:

def __init__(self, name, age)


seems you spelt "description" without an "i" on your last line as well


hahaha,..... a spelling mistake .....■■■■ i got really irritated ..and the reason was just a spelling error....
anyways .... thanks mate!


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