A Methodical Approach - Weird result


8. A Methodical Approach

So this code worked and python accepted it, but I don't understand why. I was expecting a much more clear result (current result shown below). Can anyone help explain what's happening?

<bound method Animal.description of Animal object at 0x7fb557197710

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("Roy", 26)
print hippo.description


The output you are seeing is the location and details of the description method. To see the output of the method, it needs to be invoked.



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