A Methodical Approach >> HELP


#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):
self.name = "John"
self.age = 2
print self.name
print self.age
hippo = hippo.description(self.name, self.age)

PLEASE WHAT IS WRONG WITH THE CODE?


#2

I haven't done this lesson myself, but the issue that I can see is that your def init(self, name, age): statement should have two underscores on either side of "init", like so:

def init(self, name, age):

Let me know if this helps!

Ahh, never mind. You did have the underscores, but the chat box automatically turns that into bold text. Hopefully someone with more expertise in the language will stop by to help you.


#3

It does not change anything


#4

I have figured it out. Take out the self.name and self.age under def description, also take out the last line and just create a variable for hippo


#5

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