Question: 1. Write a Python program to output the top 3 max ids without rearranging the list (without sorting). Read a list of numbers from a
1. Write a Python program to output the top 3 max ids without rearranging the list (without sorting).
Read a list of numbers from a txt file and output the top 3 max numbers.
| Input | Output | comment |
| 1 2 5 7 9 10 4 8 | 10 9 8 | - |
2. Write a Python program to output the two winning values that are closest to a winning number without rearranging the list.
| Input | Output | comment |
| 1 2 5 7 9 10 4 8 3 4 | 5 3 | List of ids on the first line, and the winning number is 4 on the 2nd line. Values 5 and 3 are the winning values, as they are closest to value 4. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
