Oops, try again. Animal('Bagheera', 42).description() did not print 'Bagheera' and '42' on separate lines as expected, instead it printed: '42' and 'Bagheera'


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

I am getting an error that it does not print the output in different lines. but it is printing in 2 lines. can u pls help.


#2

you should print the name first, then the age


#3

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