Invalid syntax


#1



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

File "python", line 1
class Animal(pass):
^
SyntaxError: invalid syntax

What am I doing wrong?

class Animal(pass):


#2

You can't derive from pass, pass does not evaluate to a class, it isn't even an expression and therefore isn't allowed there


#3

The instructions say

Create a class called Animal in the editor. For now, in the body of your class, use the pass keyword. (pass doesn't do anything, but it's useful as a placeholder in areas of your code where Python expects an expression.)
I'm starting with classes so I feel quite dumb and don't understand your reply.


#4

Actually I realized the syntax problem. Thanks.


#5

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