Welcome to the Treehouse Community
Looking to learn something new?
Kishore Kumar5,451 Points
I'm going to create a variable named time. It'll be an integer for the current hour (well, what I want the current hour to be). I need you to make an if condition that sets store_open to True if time is in store_hours. If time isn't in store_hours, set store_open to False. You'll probably have to use if, else, and in to solve this one.
store_open = None store_hours = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18] time = 20 if time in store_hours: store_open = True else: store_open = False error: store_open is not True
You don't need to set
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
That should work for you - you'd pretty much done that anyway!