Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python (retired) Objects Create a Class with a Method

How do I do this?

Don't know what the correct code would be, please help.

method.py
class Store(open, close):
  open = 9;
  close = 7;

1 Answer

Dan Johnson
Dan Johnson
40,533 Points

When dealing with classes what you put in between the parentheses is what your class will inherit from. For the actual parameters needed for constructing the object you'll use the __init__ special method.

For this first stage, all you need to do is remove open and close from the parentheses and you should be fine.

On a side note: semicolons aren't required to end statements in Python so you can remove those if you wish.

Thanks again.