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://www.codercto.com/courses/l/8.html

查看所有标签

Traction: A Startup Guide to Getting Customers

Traction: A Startup Guide to Getting Customers

Gabriel Weinberg、Justin Mares / S-curves Publishing / 2014-8-25 / USD 14.99

Most startups end in failure. Almost every failed startup has a product. What failed startups don't have is traction -- real customer growth. This book introduces startup founders and employees to......一起来看看 《Traction: A Startup Guide to Getting Customers》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

URL 编码/解码
URL 编码/解码

URL 编码/解码