Python3 min() Function

Python3 数字Python3 Numbers


Description

The min() method returns the minimum value of the given parameters, which can be a sequence.


Syntax

The following is the syntax of the min() method:

min( x, y, z, .... )

Parameters

  • x -- numeric expression.
  • y -- numeric expression.
  • z -- numeric expression.

Return Value

Returns the minimum value of the given parameters.

Examples

The following example demonstrates the use of the min() method:

#!/usr/bin/python3

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

After running the above example, the output result is:

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

Python3 数字Python3 Numbers

Other Extensions