Python Tuple(元组) max()方法

Python 教程 · 2019-02-03 05:56:57

描述

Python 元组 max() 函数返回元组中元素最大值。

语法

max()方法语法:

max(tuple)

参数

  • tuple -- 指定的元组。

返回值

返回元组中元素最大值。

实例

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

#!/usr/bin/python

tuple1, tuple2 = (123, 'xyz', 'zara', 'abc'), (456, 700, 200)

print "Max value element : ", max(tuple1);
print "Max value element : ", max(tuple2);

以上实例输出结果如下:

Max value element :  zara
Max value element :  700

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

查看所有标签

The Art of UNIX Programming

The Art of UNIX Programming

Eric S. Raymond / Addison-Wesley / 2003-10-3 / USD 54.99

Writing better software: 30 years of UNIX development wisdom In this book, five years in the making, the author encapsulates three decades of unwritten, hard-won software engineering wisdom. Raymond b......一起来看看 《The Art of UNIX Programming》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

MD5 加密
MD5 加密

MD5 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试