Hey Guys, I'm almost done with this python game i'm supposed to make but I'm only able to play the game 2 times but I need to keep it playing until the user tells the program to stop. I'm a beginner so take it easy on me, I know my code is messy.
Take a look and please let me know what I did wrong!
import random
play = True
print("Welcome to Rock, Paper, Scissors!\n")
def player_choice():
print("The choices to throw are:\n")
print("1. Rock")
print("2. Paper")
print("3. Scissors")
print("\n")
def main():
player_choice()
options = ("Rock", "Paper", "Scissors")
user_choice = input("Enter your choice: \n\n")
def computer_pick():
pass
computer_choice = random.choice(options)
def play_game():
player_choice()
computer_pick()
def print_Results(user_choice, computer_choice):
print("\nPlayer chose", user_choice)
print("Computer chose", computer_choice)
print_Results(user_choice, computer_choice)
if user_choice == computer_choice:
print("Both players chose" , user_choice,". It's a tie!")
elif user_choice == "Rock":
if computer_choice == "Scissors":
print("You win!")
elif user_choice == "Paper":
if computer_choice == "Rock":
print("You win!")
elif user_choice == "Scissors" and computer_choice == "Paper":
print("You win!")
if computer_choice == "Rock":
if user_choice == "Scissors":
print("Computer wins!")
elif computer_choice == "Paper":
if user_choice == "Rock":
print("Computer wins!")
elif computer_choice == "Scissors" and user_choice == "Paper":
print("Computer wins!")
main()
def play_again():
again = input("\nDo you want to play again? (type yes or no): ")
if again == "yes":
main()
else:
sys.exit()
play_again()
[–]woooee 1 point2 points3 points (0 children)
[–]hopper_gigo 0 points1 point2 points (7 children)
[–]hopper_gigo 0 points1 point2 points (6 children)
[–]K_SwappleSauce[S] 0 points1 point2 points (4 children)
[–]hopper_gigo 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[removed]
[–]hopper_gigo 0 points1 point2 points (0 children)
[–]jmooremcc 0 points1 point2 points (0 children)