Apr-03-2020, 01:18 AM
So I have been having this issue where if I paste a code into a new file it works but if I leave it where it's supposed to be it says 'syntax error' or is I fix that it gives me an 'IndentationError: expected an indented block'. What I am trying to make is let's call it a password system where you can only type in four things and if you fail it will say 'invalid command'. Oh yeah and by the way I want to loop this around 4 times and on the fifth try I want to do something else but if you take any less than 5 tries the tat thing won't happen. Please explain it in a starter friendly manner. Thank you! Oh yes and just to repeat I am having trouble with the else in this code.
here's the code that I want to repeat four times:
here's the code that I want to repeat four times:
else: print (" ") print ("DUDE YOU CAN'T YOU SPELL 'Calcululator' OR WHAT!? Huh go on try another time.") print (" ") Command_calculator = input("Enter Cal-cu-la-tor OK? easy: ") if Command_calculator == "calculator" or Command_calculator == "Calculator" or Command_calculator == "calc" or Command_calculator == "Calc" or Command_calculator == "Cal-cu-la-tor": else: print (" ") ("NOPE!!! Thats it! I am BANNING you from my game!") time.sleep(999999)And here's the command that I want to put after that (if all four fails):
print (" ") print ("DUDE YOU CAN'T YOU SPELL 'Calcululator' OR WHAT!? Huh go on try another time.") print (" ") Command_calculator = input("Enter Cal-cu-la-tor OK? easy: ") if Command_calculator == "calculator" or Command_calculator == "Calculator" or Command_calculator == "calc" or Command_calculator == "Calc" or Command_calculator == "Cal-cu-la-tor" else: print (" ") ("NOPE!!! That's it! I am BANNING you from my game!") time.sleep(999999)the last else is the else that I am having trouble with.