I am currently in the process of coding a simple rock, paper, scissors game in python. I am pretty confident all the functions work but I'm not sure if I'm doing the right thing when wrapping them in another function to play the game. I'm sure it's something really easy, but I can't seem to see what the issue is right now.
Here's the code:
import random
def get_computer_choice():
rps = ["Rock", "Paper", "Scissors"]
computer_choice = random.choice(rps)
return computer_choice
def get_user_choice():
user_choice = input("Choose Rock, Paper, or Scissors: ")
return user_choice
def get_winner(computer_choice, user_choice):
if computer_choice == user_choice:
print("It is a tie!")
elif computer_choice == 'Rock':
if user_choice == 'Scissors':
print("You lost")
elif user_choice == 'Paper':
print("You won!")
elif computer_choice == 'Paper':
if user_choice == 'Scissors':
print("You won!")
elif user_choice == 'Rock':
print("You lost")
elif computer_choice == 'Scissors':
if user_choice == 'Rock':
print("You won!")
elif user_choice == 'Paper':
print("You lost")
def play():
get_computer_choice()
get_user_choice()
get_winner(get_computer_choice, get_user_choice)
play()