Professional Documents
Culture Documents
4.18 LAB Smallest and Largest Numbers in A List
4.18 LAB Smallest and Largest Numbers in A List
10
5
3
21
2
-6
the output is:
2 21
You can assume that the list of integers will have
at least 2 values.
n = int(input())
min = n
max = n
while(n>0):
if(min>n):
min = n
if(max<n):
max = n
n = int(input())
print(min, max)