5/19 Runtime Error


#1

https://www.codecademy.com/courses/python-intermediate-en-WL8e4/0/5?curriculum_id=4f89dab3d788890003000096

Here is my code:

class Animal(object):
    def __init__(self, name):
        self.name = name
        
    zebra = Animal("Jeffrey")
    print zebra.name

Upon submission, I see the following:

File "python", line 4, in init
RuntimeError: maximum recursion depth exceeded while calling a Python object

Oops, try again. Did you declare a variable called zebra?

Can anyone help me with this, please?

Edit:
Okay, now the runtime error is gone even though nothing changed. However, I have a new error message:

Traceback (most recent call last):
File "python", line 1, in
File "python", line 5, in Animal
NameError: name 'Animal' is not defined


#2

Solved! Indentation issue. :slight_smile:


#3

Yup! Indentation on last two lines.

Good you discovered that. :slight_smile: