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..." sleep(1) 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: print WINNER elif user_choice_index == 1 and computer_choice_index == 0: print WINNER elif user_choice_index == 2 and computer_choice_index == 1: print WINNER elif user_choice_index > 2: print "Invalid option was selected." return else: print LOSER def play_RPS(): print "Rock, Paper, or Scissors?" user_choice = raw_input("Select R for Rock, P for Paper, or S for Scissors: ") sleep(1) user_choice = user_choice.upper() computer_choice = OPTIONS[randint(len(OPTIONS)-1)] decide_winner(user_choice, computer_choice) play_RPS
Any suggestions? What am I not seeing?
Thanks so much in advance!!!