一月5日

元组内置函数

Python元组包含了以下内置函数

序号方法及描述
1 cmp(tuple1, tuple2)
比较两个元组元素。
2 len(tuple)
计算元组元素个数。
3 max(tuple)
返回元组中元素最大值。
4 min(tuple)
返回元组中元素最小值。
5 tuple(seq)
将列表转换为元组。
posted @ 2021-01-05 15:33  hellowould  阅读(42)  评论(0编辑  收藏  举报