Write a program that takes an indefinite amount of numbers


Lab Assignment: Find the second largest number

Write a program that takes an indefinite amount of numbers as input and outputs the next largest number to the screen after the user is finished entering numbers and would like to exit.

An example of user interaction with the program is shown below:

Please enter a positive number (type -1 to exit): 99
Please enter a positive number (type -1 to exit): 42
Please enter a positive number (type -1 to exit): 73
Please enter a positive number (type -1 to exit): 24
Please enter a positive number (type -1 to exit): 444
Please enter a positive number (type -1 to exit): 324
Please enter a positive number (type -1 to exit): 20
Please enter a positive number (type -1 to exit): -1
The second largest number entered is: 324

The zipped le to turn in must include:

lab.txt: a brief text le describing the design of your program, i.e. the steps required for the calculation.

lab interactive.py: the source code using standard input/output.

lab interactive.scr: the typescript le to show that your program works with the example input provided above.

Solution Preview :

Prepared by a verified Expert
Python Programming: Write a program that takes an indefinite amount of numbers
Reference No:- TGS02459272

Now Priced at $35 (50% Discount)

Recommended (90%)

Rated (4.3/5)