Question: In PYTHON:Implement the function printTwoLargest() that inputs an arbitrary number of positive numbers from the user. The input of numbers stops when the first negative

In PYTHON:Implement the function printTwoLargest() that inputs an arbitrary number of positive numbers from the user. The input of numbers stops when the first negative or zero value is entered by the user. The function then prints the two largest values entered by the user. If fewer than two positive numbers are entered a message to that effect is printed instead of printing any numbers. If the user enters something other than a number, the program should display an error message and then continue with the entry of values. The information below shows how you would call the function and what it would display for several sample runs: In PYTHON:Implement the function printTwoLargest() that inputs an arbitrary number of positive

Python Shell File Edit Shel Debuc Jptions indows Help printTooLargest Please enter a number: 5 Please enter a Muker: 10 Please enter a number: 3 Please enter a muhker: 12 Please enter a munker: -3 The largest is 12 The second largest is 10 print TooLargest Please enter a number: 5 Please enter a mutker: 25 Please enter a number: 5 Please enter a mumber: 20 Please enter a nurker: 25 Please enter a muutker: 0 The largest is 25 The second largest is 20 printTopLargest Please enter a numiter: 1 Please enter a munker: 0 Fever than too positive nukers vere entered. print TooLargest Please enter a numker: -2 Feoer than too positive numbers were entered. printTopLargest Please enter a nunker: ten That was not a valid muurber. Please trg again, Please enter a number: ten That was not a valid number. Please trg again. Please enter a munker: 10 Please enter a munker: 5 Please enter a number: 1 Please enter a number: -3 The largest is 10 The second largest is 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!