1

this is my code:

import random
import time

validInput = False


computer = (random.choice(["rock", "paper", "scissors"]))
batman = input("welcome to rock, paper, scissors would you like to play: yes or no?"
if batman == "yes":
         choice = input("okay, these are the rules: I will say, rock, paper, scissors, shoot and then I will ask you what you picked and then tell you who won - are you ready to play: yes or no?")
         if choice == "yes":
            while validInput = False:
              time.sleep(1)

              print("rock")
              time.sleep(1)

              print("paper")
              time.sleep(1)

              print("scissors")
              time.sleep(1)

              print("shoot")
              time.sleep(1)

              what = input("what did you pick")
              if what == "rock" and computer == "rock":
                  print("I picked rock too, I guess we drawed")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "rock" and computer == "paper":
                  print("I picked paper, so I guess I won better luck next time")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "rock" and computer == "scissors":
                  print("I picked scissors, I guess you win")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "paper" and computer == "paper":
                  print("I picked paper, so I guess we drawed")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "paper" and computer == "scissors":
                  print("I picked scissors, so I guess I won better luck next time")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "paper" and computer == "rock":
                  print("I picked rock, so I guess you won")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "scissors" and computer == "scissors":
                  print("I picked scissors, so I guess we drawed")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "scissors" and computer == "rock":
                  print("I picked rock, so I guess I won better luck next time")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              if what == "scissors" and computer == "paper":
                  print("I picked paper, so I guess you won")
                  fudge = input("do you want to play again: yes or no?)
                  if fudge == "yes":
                     print("restarting program")
                     continue
                  if fudge == "no":
                     print("okay, terminating program")
                     exit()
                  else:
                     print("invalid input, terminating program")
                     exit()
              else:
                  chicken = input("invalid input, do you want to try again: yes or no?")
                  if chicken == "yes":
                      print("restarting now")
                      invalidInput = False
                      continue
                  if chicken == "no":
                      print("okay, terminating program")
                      invalidInput = True
                      exit()
                  else:
                      print("invalid input, terminating program")
                      invalidInput = True
                      exit()


         if choice == "no":
               print("okay terminating program")
               invalidInput = True
               exit()
         else:
             print("invalid input, terminating program")
             exit()

if batman == "no"
   print("okay, terminating program")
   exit()

else:
   print ("invalid input, terminating program")
   exit()

i don't know why it isn't working all it tells me is

SyntaxError: multiple statements found while compiling a single statement.

could someone please help thank you.

Oh also i'm running python on 3.6.0

2
  • 4
    while validInput = False:: = != == Commented Jul 9, 2017 at 13:06
  • 4
    the highlighting here shows that you are missing a closing quote after: fudge = input("do you want to play again: yes or no?) Commented Jul 9, 2017 at 13:06

1 Answer 1

2
  • In the while loop you are making an assignment, not a comparison, change = to ==.

  • Every time you use fudge() there are missing quotes at the end.

  • At the end, you have if batman == "no" where it should have been if batman == "no": (note the two points).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.