Computer >> Computer tutorials >  >> Programming >> Python

How to find the greatest number in a list of numbers in Python?


Python's built-in library function max() returns the largest number in an iterable or commaa separated list of numbers.

>>> max(10,23,43,21)
43
>>> l1=[4,7,2,9,1]
>>> max(l1)
9