#sample solution
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 "My name is %s." % (self.name)
print "I'm %s years old." % (self.age)
hippo = Animal("Hippy",70)
hippo.description()
not working: Oops, try again. Animal('Baloo', 24).description() did not print 'Baloo' and '24' on separate lines as expected, instead it printed: 'My name is Baloo.' and "I'm 24 years old."
ReplyDelete