Python Python Basics (2015) Logic in Python Membership

Rasmus Andersen
Rasmus Andersen
1,569 Points

I dont get what is wrong with this code Bummer: IndentationError: unexpected indent

I need help to solve this problem. I know indentation matters in python but I have the same amount of indents on both if and else

membership.py
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

1 Answer

Roman Rheingans
Roman Rheingans
8,386 Points

The conditional block needs to be all the way left-aligned to start that block

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