Loading...
Loading...
Loading...
A report needs three numbers for any number of marks. Write summary(*marks) that returns the total, the highest and the lowest. The first input line gives how many marks follow (1 to 3), then each mark is on its own line. Call summary with exactly those marks and print the three values on one line.
Example
Input
3 70 85 60
Output
215 85 60
Total 215, highest 85, lowest 60.
Try the problem first. Open one hint at a time.
Start the total at 0, the highest below any mark and the lowest above any mark, then update them in a for loop over marks.
Inside the function marks holds all the arguments together, and a for loop visits them one by one.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor