Relative Content

Tag Archive for pythonvalidationwhile-loop

How do I get my code to reject invalid input and repeat the prompt? [duplicate]

This question already has answers here: Asking the user for input until they give a valid response (23 answers) Closed yesterday. I need this code to only accept “y” or “n” for the sYesOrNo input. If user enters invalid input, I need it to re-display the sYesOrNo input prompt. It repeats the loop if user […]

How do I get my code to reject invalid input and repeat the prompt? [duplicate]

This question already has answers here: Asking the user for input until they give a valid response (23 answers) Closed yesterday. I need this code to only accept “y” or “n” for the sYesOrNo input. If user enters invalid input, I need it to re-display the sYesOrNo input prompt. It repeats the loop if user […]