0
Game: restart feature
Why doesn't this code work? I get an 'expected indented block' error. print("Player died") restart = input('Restart? y/n') if restart in ['y', 'n']: if restart == 'y': # code for y if restart == 'n': # code for n) else: print('typed something else other than y/n') restart
1 Answer
0
Is this your exact code? If yes, then you cannot have an if statement without any other statements inside.
For example:
if restart == "y":
#code for y
if restart == "n":
In here, you have no other statement after if statement. Just add a line after
if restart == "y":
And it will work fine.