Luuk de Reus1,936 Points
I don't understand the IF and ELSE code format
I tried but failed. I don't know what I did wrong!
Thanks in advance Treehousers!
time = 15 store_open = None store_hours = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18] if: time in store_hours store_open = True else: store_open = False
Chris FreemanTreehouse Moderator 59,156 Points
You are SO close! The
else needs to be indented the same amount as the
And the colon (:) goes at the end of the
The colon is used to signify a block of code follows this statement, the code block should be indent. The first line not indented as much as the code block marks the end of the code block.
In this case, the unindented
else ends the code block from the
Post back if you need more help. Good luck!!!