I'm building a rock,paper and scissor simulator where you can play with the AI.
print('1.Rock 2.Scissors 3.Paper')
choice = int(input('Input your choice:\n'))
One part of the code asks the user to input what he wants to show. If the player wants to play rock,paper,scissor. So for example if someone wants to use rock he would input 1. I would like to don't let the user input any other number or letter, or if he inputs to show an error and ask again the question.
What should I use? I'm thinking about using if, but I think that there exists a better way.