Python3 List max()方法

Python 3 教程 · 2019-02-06 11:26:31

描述

max() 方法返回列表元素中的最大值。

语法

max()方法语法:

max(list)

参数

  • list -- 要返回最大值的列表。

返回值

返回列表元素中的最大值。

实例

以下实例展示了 max()函数的使用方法:

#!/usr/bin/python3

list1, list2 = ['Google', 'Codercto', 'Taobao'], [456, 700, 200]

print ("list1 最大元素值 : ", max(list1))
print ("list2 最大元素值 : ", max(list2))

以上实例输出结果如下:

list1 最大元素值 :  Taobao
list2 最大元素值 :  700

点击查看所有 Python 3 教程 文章: https://codercto.com/courses/l/10.html

查看所有标签

How to Build a Billion Dollar App

How to Build a Billion Dollar App

George Berkowski / Little, Brown Book Group / 2015-4-1 / USD 24.95

Apps have changed the way we communicate, shop, play, interact and travel and their phenomenal popularity has presented possibly the biggest business opportunity in history. In How to Build a Billi......一起来看看 《How to Build a Billion Dollar App》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器