Objective
Create a Python program that asks for an integer between 1 and 10 and keeps asking until the user types a valid one.
Instructions
- Read a text on each attempt.
- If it is not an integer or it is not between 1 and 10, show
Try againand ask again. - When the value is valid, show
You chose N, with the number in place ofN. - Use a
whileloop andtry/exceptto catchValueError.
5
You chose 5
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise