A methodical approach


#1

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)

hippo.descrpition()

what is wrong here?


#2

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)

#3

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


#4

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


#5

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