TUTORIAL编程语言与算法FETCHED
Python Tuple(元组) min()方法
Python Tuple(元组) min()方法 Python 元组 描述 Python 元组 min() 函数返回元组中元素最小值。 语法 min()方法语法: min(tuple) 参数 tuple -- 指定的元组。 返回值 返回元组中元素最小值。 实例 以下实例展示了 min()函数的使用方法: #!/usr/bin/python tuple1, tuple2 = (123, 'xyz', &..
更新于 2026/7/16
教程详情页默认 noindex。
Python Tuple(元组) min()方法
描述
Python 元组 min() 函数返回元组中元素最小值。
语法
min()方法语法:
min(tuple)
参数
- tuple -- 指定的元组。
返回值
返回元组中元素最小值。
实例
以下实例展示了 min()函数的使用方法:
#!/usr/bin/python tuple1, tuple2 = (123, 'xyz', 'zara', 'abc'), (456, 700, 200) print "min value element : ", min(tuple1); print "min value element : ", min(tuple2);
以上实例输出结果如下:
min value element : 123 min value element : 200
Python 元组