Python3 List min()方法

Python 3 教程 · 2019-02-06 11:43:27

描述

min() 方法返回列表元素中的最小值。

语法

min()方法语法:

min(list)

参数

  • list -- 要返回最小值的列表。

返回值

返回列表元素中的最小值。

实例

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

#!/usr/bin/python3

list1, list2 = ['Google', 'Codercto', 'Taobao'], [456, 700, 200]

print ("list1 最小元素值 : ", min(list1))
print ("list2 最小元素值 : ", min(list2))

以上实例输出结果如下:

list1 最小元素值 :  Google
list2 最小元素值 :  200

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

查看所有标签

High Performance Python

High Performance Python

Micha Gorelick、Ian Ozsvald / O'Reilly Media / 2014-9-10 / USD 39.99

If you're an experienced Python programmer, High Performance Python will guide you through the various routes of code optimization. You'll learn how to use smarter algorithms and leverage peripheral t......一起来看看 《High Performance Python》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具