Python Python Basics (2015) Logic in Python Membership

Sean Frye
Sean Frye
1,166 Points

Shoot! I thought this was what I was supposed to do.

Well I'm back asking for help again. I gotta get this down and stop needing help or else I'm not going to be hire-able in the field of coding. I feel like I got it down, but I clearly don't. I feel like I understand what these commands are supposed to do, but even though I feel certain about it, I'm doing them wrong thus far. It really doesn't look hard, but I keep getting stumped anyways. I'm having difficulty figuring out what exactly I am supposed to do because I feel like I am getting this down, but apparently not.

membership.py
time = 15

store_open = None
store_hours = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
if time in store_hours = 15:
    store_open = True

1 Answer

  • Why do you have = 15 at the end of the 5th line of code?
  • Did you assign store_open to False if the time isn't in the store_hours?

Happy coding! :zap: ~Alex

Sean Frye
Sean Frye
1,166 Points

Hm. It looks like I have a lot of work to do to fix this.

Sean Frye
Sean Frye
1,166 Points

I finally got it right. I had to be rewatching the video while working on the quiz.

:+1: