Python Introduction to Classes Instantiation


#1

Have the exact right code (same as is in the "hint"), is functioning correctly, but the interpreter throws an error.

code:

class Animal(object):
def init(self, name):
self.name = name

zebra = Animal("Jeffery")
print zebra.name

Error:

Oops, try again. Did you set your zebra's name to 'Jeffrey' with zebra = Animal('Jeffrey')?


#2

Hi thsi line

zebra = Animal("Jeffery")

you wrote "Jeffery" instead of "Jeffrey"


#3

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