Question: By using an if - elif - else structure, write a program that reads a number entered by the user. The entered number should be
- By using an if-elif-else structure, write a program that reads a number entered by the user.
- The entered number should be in the range 1 6.
- The number entered by the user should then be checked to make sure it is in the right range.
- If a user enters a number outside of the range 1 6, then your program should display the following message and exit:
Sorry, number is out of range.
[Replacing number with the value the user entered.]
If they entered a number in the range, the appropriate message should be displayed:
| Range | Message | ||||||||
|
| ||||||||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
