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

Carole Cox
Carole Cox
429 Points

Again-confused!

I can't see why I am getting the message that store_open is not true. I've tried putting the number in brackets as a list, quotes...etc because I thought Python may not be "seeing" things correctly. Again, my logic looks ok....

membership.py
store_open = None
store_hours = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
time = "12"
if time in store_hours:
  store_open = True 
time = "3"
if time not in store_hours:
  store_open = False

3 Answers

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

HI Carole,

you don´t need to set time yourself. The challenge will do it for you !

Delete both time lines :)

Grigorij

Carole Cox
Carole Cox
429 Points

I always make these challenges harder than what they need to be. I think I am actually trying to do the program- not the challenge.

Thank you again for the speedy answer! It worked! I was concerned because the challenge mentioned using else but I did not see a need for it. It passed without it . I suppose the challenge just wanted me to THINK -always a good thing until I overthink!

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

:)

The best thing is to practice ...

See you in the forum, Carole

G

Carole Cox
Carole Cox
429 Points

Hi Grigorij!

I just wanted to say hello and tell you that I have got through several challenges without any help! I appreciate your continued support. Are you in Boston yet?

Safe travels!