Question: Python. Help please Exercise 4 det print_two_smallest(): Inputs: none. The function uses input to ask the user for data Results: prints the 2 smallest numbers

 Python. Help please Exercise 4 det print_two_smallest(): Inputs: none. The function

Python. Help please

Exercise 4 det print_two_smallest(): Inputs: none. The function uses input to ask the user for data Results: prints the 2 smallest numbers the user entered Details: The function repeatedly prompts the user for a number. While the entered numbers are not negative numbers, the functions saves the number and prompts again. As soon as a negative number is entered the function finds the 2 smallest numbers (not including the negative number and prints them. The prompt text must be "Enter a number: The output format is: lowest: ca number 2nd lowest: ca number> Two error conditions need to be detected and handled: 1. When the user enters something other than a number, the function prints "Not a valid number, try again, and continues to prompt for numbers. 2. When the user has entered less than 2 non-negative numbers, then enters a negative number, the function prints "Not enough entries and quits Please note that the self test for this function is a little complicated due to the input function. If the self test seems to freeze or is actually prompting for input, that means the self test isn't working for some reason. The primary reason would be that the test cannot find the input file that replaces user input. Check that the program file and nums, bet are in the same folder. If you have such problems and cannot resolve the quickly, let me know Example output >>> print_two_smallest Enter a number: 7 Enter a number: 5 Enter a number: 8 Enter a number: 2

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!