FAQ: Learn Python: Classes - Methods


This community-built FAQ covers the “Methods” exercise from the lesson “Learn Python: Classes”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science

FAQs on the exercise Methods

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


I am having a problem with the compiler with this exercise. The very first step gives me the error: “SyntaxError: unexpected EOF while parsing” with the code:

class Rules:

I checked and its the exact same as the solution given by codecademy (not much difficulty in this very first step…)

Any ideas on why?


i had the same problem.
i think the reason why is because just wrighting the class is not the right proper syntaxt.
an class alawys needs to be defined. if you want to define an empty class you should use.

class Rules:

and then later when you continue the code you can get rid of pass that is how i did it