Invalid syntax


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

What am I doing wrong?

class Animal(pass):


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


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.


Actually I realized the syntax problem. Thanks.


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