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

查看所有标签

Building Websites with Joomla!

Building Websites with Joomla!

H Graf / Packt Publishing / 2006-01-20 / USD 44.99

This book is a fast paced tutorial to creating a website using Joomla!. If you've never used Joomla!, or even any web content management system before, then this book will walk you through each step i......一起来看看 《Building Websites with Joomla!》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

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

Base64 编码/解码

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

RGB CMYK 互转工具