Maximum and Minimum Values for Ints in Python



Python's core library has two built-in functions max() and min() respectively to find maximum and minimum number from a sequence of numbers in the form of list or tuple object.

example

>>> max(23,21,45,43)
45
>>> l1=[20,50,40,30]
>>> max(l1)
50
>>> t1=(30,50,20,40)
>>> max(t1)
50
>>> min(l1)
20
>>> min(t1)
20
>>> min(23,21,45,43)
21

Updated on: 2020-02-21T12:51:33+05:30

111 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements