码迷,mamicode.com
首页 > 编程语言 > 详细

Python 函数-max()

时间:2017-06-22 00:15:28      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:python 函数   实例   pre   strong   style   code   nbsp   序列   输出   

max( x, y, z, .... )
max() 方法返回给定参数的最大值,参数可以为序列。返回给定参数的最大值。x、y、z数值表达式。

实例


1 #!/usr/bin/python
2 
3 print "max(80, 100, 1000) : ", max(80, 100, 1000)
4 print "max(-20, 100, 400) : ", max(-20, 100, 400)
5 print "max(-80, -20, -10) : ", max(-80, -20, -10)
6 print "max(0, 100, -400) : ", max(0, 100, -400)

输出:

1 max(80, 100, 1000) :  1000
2 max(-20, 100, 400) :  400
3 max(-80, -20, -10) :  -10
4 max(0, 100, -400) :  100

 

 

Python 函数-max()

标签:python 函数   实例   pre   strong   style   code   nbsp   序列   输出   

原文地址:http://www.cnblogs.com/guyuyuan/p/7062069.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!