A Methodical Approach


This won’t print the description. Any tips please?

class Animal(object):
  """Makes cute animals."""
  is_alive = True
  def __init__(self, name, age):
    self.name = name
    self.age = age
def description(self):
  print self.name
  print self.age
hippo = Animal("Ben", 7)

print hippo.description()


Hi @coldweb,

The entire description method definition needs to be indented in order for it to be part of the Animal class definition.


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