subject

I wrote a rock paper scissors game in python but I cannot get it to play again once the user choices a yes option. The rest of the program works. Here's what I have:
import random
playAgain = True
choice = input("Enter Rock(R), Paper(P), or Scissors(S): ")
computer = random. randint(1, 3)
if computer == 1:
print("Computer played R.")
elif computer == 2:
print("Computer played P.")
else:
print("Computer played S.")
#Winning conditions
if computer == 1 and choice == "R":
print("Computer played Rock.")
print("Tie")
elif computer == 2 and choice == "P":
print("Computer played Paper.")
print("Tie")
elif computer == 3 and choice == "S":
print("Computer played Scissors.")
print("Tie")
elif computer == 1 and choice == "S":
print("Computer played Rock.")
print("You Lose")
elif computer == 2 and choice == "R":
print("Computer played Paper.")
print("You Lose")
elif computer == 3 and choice == "P":
print("Computer played Scissors.")
print("You Lose")
elif computer == 1 and choice == "P":
print("Computer played Rock.")
print("You Win")
elif computer == 2 and choice == "S":
print("Computer played Paper.")
print("You Win")
elif computer == 3 and choice == "R":
print("Computer played Scissor.")
print("You Win")
#Play again?
choice = input("Play Again? ")
while playAgain == True:
if choice == "y":
playAgain = True
elif choice == "yes":
playAgain = True
if choice == "Yes":
playAgain = True
elif choice == "Y":
playAgain = True
elif choice == "n":
print("Thanks for playing!")
exit()
elif choice == "no":
print("Thanks for playing!")
exit()
elif choice == "N":
print("Thanks for playing!")
exit()
elif choice == "No":
print("Thanks for playing!")
exit()
else:
print("Please input a vaild option.")
choice = input("Play Again? ")

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Aplan to budget time for studying and activities is referred to as a study routine. study habits. study skills. a study schedule.
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
How do you share someone else’s tweet with your own twitter followers?
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
You know the right answer?
I wrote a rock paper scissors game in python but I cannot get it to play again once the user choices...
Questions
question
Mathematics, 03.07.2020 21:01
question
Mathematics, 03.07.2020 21:01
question
Mathematics, 03.07.2020 21:01