Question: How to write a python program for the following purposes? First, getting user input for the question What item do you want to buy?. Then

How to write a python program for the following purposes?

First, getting user input for the question "What item do you want to buy?". Then the user will type the number into the terminal. The only acceptable numbers are 1, 2, 3, 4, and 5. If the user inputs any float numbers, the terminal will show "Numerical value only!" and return to the first question to ask for number input. If the user inputs any other integers such as 0, -1, 6, 7..., the terminal will show "No such item" and return to the first question again. Only when the user inputs any numbers from 1, 2, 3, 4, or 5, the program will stop the loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!