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

查看所有标签

C# Primer Plus

C# Primer Plus

Klaus Michelsen / Sams / 2001-12-15 / USD 49.99

C# Primer Plus is a tutorial based introduction to the C# language and important parts of the .Net Framework. Throughout the book the reader will be exposed to proven principles enabling him to write ......一起来看看 《C# Primer Plus》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

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

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具