Question: DO NOT USE isdigit FUNCTION Write a Python Program that prompts for an integer and prints the integer, but if something other than an integer

DO NOT USE isdigit FUNCTION

Write a Python Program that prompts for an integer and prints the integer, but if something other than an integer is input, the program keeps asking for an integer. Here is a sample session:

integer: abc

Error: try again.

Input an integer: 4a

Error: try again.

Input an integer: 2.5

Error: try again.

Input an integer: 123

The integer is: 123

Hint: the string isdigit method will be useful to solve this problem, but you are not allowed to use it in this program

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!