programming-examples/python/List/Python program to get the smallest number from a list.py
2019-11-15 12:59:38 +01:00

7 lines
190 B
Python

def smallest_num_in_list( list ):
min = list[ 0 ]
for a in list:
if a < min:
min = a
return min
print(smallest_num_in_list([1, 2, -8, 0]))