I can't seem to fix this SyntaxError:
SyntaxError: 'return' outside function
$ python RPS.py
File "RPS.py", line 33
from random import randint
from time import sleep
OPTIONS = ['R', 'P', 'S']
LOSER = 'You lost!'
WINNER = 'You WIN!'
def decide_winner(user_choice, computer_choice):
print "You selected: %s" % user_choice
print "Computer selecting..."
print "Computer selects: %s" % computer_choice
user_choice_index = OPTIONS.index(user_choice)
computer_choice_index = OPTIONS.index(computer_choice)
if user_choice_index == computer_choice_index:
print "It\'s a TIE!"
elif user_choice_index == 0 and computer_choice_index == 2:
elif user_choice_index == 1 and computer_choice_index == 0:
elif user_choice_index == 2 and computer_choice_index == 1:
elif user_choice_index > 2:
print "Invalid option was selected."
print "Rock, Paper, or Scissors?"
user_choice = raw_input("Select R for Rock, P for Paper, or S for Scissors: ")
user_choice = user_choice.upper()
computer_choice = OPTIONS[randint(len(OPTIONS)-1)]
Any suggestions? What am I not seeing?
Thanks so much in advance!!!