I am making a rock paper scissors game. Everything works, except I cannot understand why the second while loop is not working in this code. I want to make the program so that if the user does not enter "R" or "P" or "S" then the user will be told it was an invalid entry and it will prompt the user to enter their answer again. It works perfectly fine for player1, but it does not work for player2. For player2, if you do not enter either "R" or "P or "S", then it will prompt you to enter a new value again, but only once, regardless of what you put in. All help appreciated!
if playGame == "Y":
print("Ok, here we go.")
player1 = input("Player1, what is your choice, R, P, or S? ")
player1 = player1.upper()
while player1 != 'R' and player1 != 'P' and player1 != 'S':
player1 = input("Invalid answer. Please answer R, P, or S: ")
player1 = player1.upper()
player2 = input("Player2, what is your choice, R, P, or S? ")
player2 = player2.upper()
while player2 != 'R' and player2 != 'P' and player2 != 'S':
player2 = input("Invalid answer. Please answer R, P, or S: ")
player2 = player1.upper()