Errors on Rock, paper, scissors

edit: found the problem

Hi guys

I am getting these errors:


I have copied the code from the walkthrough video. What is the problem?

Here is my code

#This program plays the game of rock-paper-scissors with the user. It asks the user for input and does a random choice of what the computer's hand is. It then compares these two and announces a winner.

from random import randint

options = ["ROCK", "PAPER", "SCISSORS"]

message = {
 "tie": "Yawn it's a tie!", "won": "Yay you won!", 
"lost": "Aww you lost!"

def decide_winner(user_choice, computer_choice):
  print "You selected: %s" % user_choice 
  print "The computer selected %S" % computer_choice
  if user_choice == computer_choice:
    print message["tie"]
  elif user_choice == options[0] and computer_choice == options[2]:
    print message["won"]
  elif user_choice == options[1] and computer_choice == options[0]:
    print message["won"]
  elif user_choice == options[2] and computer_choice == options[1]:
    print message["won"]
    print message["lost"]
def play_RPS():
  user_choice = raw_input("Enter ROCK, PAPER, or SCISSORS: ").upper()
  computer_choice = options[randint(0, 2)]
  decide_winner(user_choice, computer_choice)
1 Like

I get your problem. print() requires brackets to print. Did you remember to type them?

additionally, the print() statement for the computer may have been messed up, so i have created a remade version of your code which is not too different. i think that the %S may have been a problem.

Oh and the str() statements are not required.