How to know Maximum and Minimum values for ints in Python?

PythonServer Side ProgrammingProgramming

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

raja
Published on 24-Feb-2018 06:20:49
Advertisements