Easy Tutorial
❮ Python Func Number Min Ref Math Tau ❯

Python3 max() Function

Python3 Numbers


Description

The max() method returns the largest value among the given arguments, which can be a sequence.


Syntax

Here is the syntax for the max() method:

max(x, y, z, ....)

Parameters


Return Value


Example

The following examples demonstrate the use of the max() method:

#!/usr/bin/python3

print("max(80, 100, 1000) : ", max(80, 100, 1000))
print("max(-20, 100, 400) : ", max(-20, 100, 400))
print("max(-80, -20, -10) : ", max(-80, -20, -10))
print("max(0, 100, -400) : ", max(0, 100, -400))

The output of the above examples is:

max(80, 100, 1000) :  1000
max(-20, 100, 400) :  400
max(-80, -20, -10) :  -10
max(0, 100, -400) :  100

Python3 Numbers

❮ Python Func Number Min Ref Math Tau ❯