While trying to put if
's and elif
's in a while
loop, it would automatically indent the elif
under the if
. I tried deleting the indentation, but when I went to test it, I get an indentation error:
expected an indented block
So I tried adding the indentation back, which just seems strange since this is the first time this has happened. I then got a plain syntax error.
I tried removing the indentation: received indent error.
I tried including indentation: received syntax error.
def airlock(inventory):
clear()
userin = None
inventory["note"] = "your astronaut ID is: 2579"
while userin != "quit":
time.sleep(1.5)
print("description of airlock, keypad on wall next to door")
print("what u wanna do? 1 look around 2 check pockets 3 go to keypad")
userin = input()
if userin == "1":
#describe the keypad. there is nothing else in the room
elif userin == "2":
invinspect(inventory)
def invinspect(inventory):
userin = None
print(inventory.keys())
print("what would you like to do? 1. look closer 2 go back")
userin = input()
if userin == 1:
print(str(inventory))
else:
def main():
inventory = {}
airlock(inventory)
main()