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! While you're at it, check out some resources Treehouse students have shared here.

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 Python Basics (2015) Logic in Python Membership

traolach trewhella
traolach trewhella
Courses Plus Student 835 Points

okay i can tell i messed up my syntax please help and explain thanks

thanks so much for this help im trying my best with this lesson and i understand the meaning of this lesson just need to brush up on my code!

store_open = None
store_hours = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
if store_store in store_open: = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
  print("come on in")
    print("sorry we're closed")

1 Answer

Matt Nickele
Matt Nickele
468 Points

you never define store_store and it should be in store_hours not store_open. Store open does not have a value.

I am assuming store_store is the time the user inputs and if that is the case the if statement should read

if store_store in store_hours: you also should not define a function in the if statement/ I am not sure you can, I have never tired that before