Checkpoint 12.2.1.
You can now write a function called
get_float
which takes a prompt string as its parameter and returns a user’s input. The function will continue to ask the user for input as long as the input is non-numeric.Here is what output from a sample run might look like. Your output does not have to match this exactly, but it must convey the same information.
Enter price:five dollars and 78 cents Please use numeric input. Enter price:5.78 Enter discount percent:2 Price after discount is $5.66.