Question: Write a function get _ user _ input ( ) , which takes three parameters: a string message, two integers to indicate the smallest and

Write a function get_user_input(), which takes three parameters: a string message, two integers to indicate the smallest and the largest allowed input values, and returns an integer value the user entered. This function will use the message to prompt the user for an integer and make sure that the user enters a valid value (of type float). If the user input is invalid, print a message and allow the user to try again. A sample use of this function will be:
val = get_user_input('Enter an integer (0 to 5): ',0,5)

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!