They're Multiplying


#1


I got this error
My code:

class Animal(object):
    """Makes cute animals."""
    is_alive = True
    health = "good"
    def __init__(self, name, age):
        self.name = name
        self.age = age
    # Add your method here!
    def description(self):
        return self.name
        return self.age
        
hippo = Animal("Hipster", 1)
sloth = Animal('Spot',7)
ocelot = Animal('CAtt',3)
print hippo.description
print hippo.health
print sloth.health
print ocelot.health

I refreshed and also closed the tab, but doesn't work.


#2

HI this line

sloth = Animal('Spot',7)

if you look well you will see that the ( ) are a bit different of the others just change it to

sloth = Animal('Spot',7)

#3

And "CAtt" needs to be spaced as well.


#4

My new code works. Thanks!!

class Animal(object):
    """Makes cute animals."""
    is_alive = True
    health = "good"
    def __init__(self, name, age):
        self.name = name
        self.age = age
    # Add your method here!
    def description(self):
        return self.name
        return self.age
        
hippo = Animal("Hipster", 1)
sloth = Animal('Spot',7)
ocelot = Animal('CAtt',3)
print hippo.description
print hippo.health
print sloth.health
print ocelot.health

#5

(You didn't change anything on the code, but I'm glad it worked!) :sweat_smile:


#6

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