Try:
store_open = None
store_open = False
store_hours = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
if "time" in store_hours:
store_open = True
else:
store_open = False
Advice:
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.
The debugger allow you to follow the execution line by line, inspect variables and you will see that there is a point where it stop doing what you expect.
Debugger - Wikipedia, the free encyclopedia[
^]
Debugging in Python | Python Conquers The Universe[
^]
Debugging Python Like a Boss - The Zapier Engineering Blog - Zapier[
^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[
^]
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
[Update]
Quote:
That doesn't work.
The change I gave you is about the error message you claim
"Bummer! `store_open` is not True.".
I never said I did not suspect the
if
statement to be wrong.
And you need to learn the debugger soon.
By the way, giving error position also help us to see what is wrong.
I don't see any reason to get your error message in the code you provided, even the error message itself is weird.