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!

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

class Store: open = 0 close = 9 what is wrong?

close is colored gray, why? also it does not suits

class Store:
    open = 0
    close = 9

1 Answer

Chris Freeman
Chris Freeman
Treehouse Moderator 68,390 Points

Hey Kirill,

The challenge seems to be expecting positive integer values for the open and close times values. It accepts "13" so it "0" seems reasonable for a 24-hour clock value.

Tagging Kenneth Love for review of using "0" as time value on the create a class with a method challenge.

The "open" is colored because it is also the name of a built-in function. The coloring is a simple editor coding guidance and does not affect the functionality of the code. While there isn't a rule that prevents using the name of built-in function name as a variable, it is usually considered a bad practice since it would subsequently prevent from calling the open() function. Similarly, using list as a variable name would prevent calling the list() function later in the code. In short coding examples, it doesn't matter either way.