Welcome to the Treehouse Community
Looking to learn something new?
Chris FreemanTreehouse Moderator 68,167 Points
I suspect the error message is
'close' is not defined. The question is then, for your "close", where is it defined?
"close" is looked for in the following places:
- a local variable to hours(): Nope!
- a parameter to `hours()': Nope!
- a instance attribute: Nope! (you'll learn more about these later)
- a class attribute: BINGO! open and close are class attributes that can be reference using
self. to your format parameters:
BTW, the reason that open wasn't flagged as "not defined" is because open() is a built-in function which I suspect is not what you want to pass to your format() string. It's a HORRIBLE name to use as a coding example. IMHO