Python min() function
Description
The min() method returns the minimum of the given arguments, which may be a sequence.
Syntax
The syntax of the min() method is as follows:
min( x, y, z, .... )
Parameters
- x -- a numeric expression.
- y -- a numeric expression.
- z -- a numeric expression.
Return Value
Returns the minimum of the given arguments.
Example
The following shows examples of using the min() method:
#!/usr/bin/python
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)
Running the example above produces:
min(80, 100, 1000) : 80
min(-20, 100, 400) : -20
min(-80, -20, -10) : -80
min(0, 100, -400) : -400
Python Numbers