Class Syntax - What is going on?


#1



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

Error:
Oops, try again. Did you create a class with the name Animal?
File "python", line 1
class Animal(pass):
^
SyntaxError: invalid syntax


class Animal(pass): 

Replace this line with your code.


#2

here:

class Animal(pass):

Animal inherits of object, not pass

pass should be in the object:

class Animal(object):
    # pass here, class can't be empty

#3

Thank you, makes sense.


#4

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