programming-examples/python/List/Python program to get the largest number from a list.py

7 lines
180 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def max_num_in_list( list ):
max = list[ 0 ]
for a in list:
if a > max:
max = a
return max
print(max_num_in_list([1, 2, -8, 0]))