Python Forum
Help Me With This Issue Please
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Me With This Issue Please
#1
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:

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.
Reply


Messages In This Thread
Help Me With This Issue Please - by 00banyaszo00 - Apr-03-2020, 01:18 AM
RE: Help Me With This Issue Please - by ndc85430 - Apr-03-2020, 03:27 AM
RE: Help Me With This Issue Please - by perfringo - Apr-03-2020, 12:40 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020