Im trying to write a rock paper scissor program where the choice are 1, 2, and 3. I want to validate the input so that any input other than these three choice will print a message saying the input is valid, and ask the user to reinput the data. I have it somewhat working, however, even if i do enter 1 2 or 3, it will still print the message and ask for more input.
print("This program simulates a 'rock paper scissor' game.")
print("The rules are as follows: rock beats scissor, paper beats rock, and scissor beats paper. \n")
print("This program simulates a 'rock paper scissor' game.")
print("The rules are as follows: rock beats scissor, paper beats rock, and scissor beats paper. \n")
#get user input
user_choice = input("Please choose from the following: \n"
" 1 for scissor \n"
" 2 for rock \n"
" 3 for paper. \n")
#validate input so user only enters 1, 2, or 3
while user_choice != 1 or user_choice != 2 or user_choice != 3:
user_choice = input("Please enter only '1' for scissor, '2' for rock, or '3' for paper: ")
#convert input to int
int_user_choice = int(user_choice)