Tutorials Point


  Python Basics
  Python Advanced
  Python Useful References
  Python Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

Python Number max() Function


previous next AddThis Social Bookmark Button


Description:

This function returns the largest of its arguments: the value closest to positive infinity.

Syntax:

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

Parameters:

Here is the detail of parameters:

  • x: This is a numeric expression.

  • y: This is also a numeric expression.

  • z: This is also a numeric expression.

Return Value:

The largest of its arguments

Example:

#!/usr/bin/python

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)

This will produce following result:

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


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names