Objective
Create a Python program that finds the smallest and the largest value of a list by going through it only once.
Instructions
- Read a line with integers separated by spaces (at least one).
- Without using
min()ormax(): start from the first number being both the minimum and the maximum and update both while going through the rest. - Show
Minimum: Xon the first line andMaximum: Yon the second.
5 3 9 1 7
Minimum: 1
Maximum: 9
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise