Python List max()方法
Python 教程
· 2019-02-02 20:27:26
描述
max() 方法返回列表元素中的最大值。
语法
max()方法语法:
max(list)
参数
- list -- 要返回最大值的列表。
返回值
返回列表元素中的最大值。
实例
以下实例展示了 max()函数的使用方法:
#!/usr/bin/python list1, list2 = ['123', 'xyz', 'zara', 'abc'], [456, 700, 200] print "Max value element : ", max(list1); print "Max value element : ", max(list2);
以上实例输出结果如下:
Max value element : zara Max value element : 700
点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html
How to Solve It
Zbigniew Michalewicz、David B. Fogel / Springer / 2004-03-01 / USD 59.95
This book is the only source that provides comprehensive, current, and detailed information on problem solving using modern heuristics. It covers classic methods of optimization, including dynamic pro......一起来看看 《How to Solve It》 这本书的介绍吧!