Bug Intro to Classes, Mod 8?


#1

Hi Roy,

Instruction:

This module may be submitted without the 2nd part of the instruction completed, like so:

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(Animal):
        print Animal.name
        print Animal.age

This is the 2nd part:

hippo = Animal("Jerry", 42)
hippo.description()

I'm not sure if this is by design. Thanks!


#2

#3

This method will take only one argument, self.

def descriptioin(self):
    print self.name

#4

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