Question: Please give me an example code in Python 3.7. Thank you very much for your help. 11. Write a function named safe input (prompt, type)
Please give me an example code in Python 3.7.
Thank you very much for your help.

11. Write a function named safe input (prompt, type) that works like the Python input function, except that it only accepts the specified type of input. The function takes two arguments: o prompt: str o type: int, float, str The function will keep prompting for input until correct input of the specified type is entered The function returns the input. If the input was specified to be a number (float or int), the value returned will be of the correct type; that is, the function will perform the conversion. The default for a prompt is the empty string. The default for the type is string. 11. Write a function named safe input (prompt, type) that works like the Python input function, except that it only accepts the specified type of input. The function takes two arguments: o prompt: str o type: int, float, str The function will keep prompting for input until correct input of the specified type is entered The function returns the input. If the input was specified to be a number (float or int), the value returned will be of the correct type; that is, the function will perform the conversion. The default for a prompt is the empty string. The default for the type is string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
