This article briefly introduces the min () method used in Python to obtain the minimum value. it is a basic knowledge in Python. For more information, see min () method returns the minimum value of its parameter: the value closest to the negative infinity.
Syntax
The syntax of the min () method is as follows:
Min (x, y, z ,....)
Parameters
- X -- this is a numeric expression.
- Y -- this is also a numeric expression.
- Z -- this is also a numeric expression.
Return value
This method returns the smallest of its parameters.
Example
The following example shows how to use the min () method.
#! /Usr/bin/pythonprint "min (80,100,100 0):", min (80,100,100 0) 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)
When we run the above program, it will produce the following results:
Min (80,100,100 0): 80 min (-20,100,400):-20 min (-80,-20,-10):-80 min (0,100,-400):-400