Python3 列表
描述
min() 方法返回列表元素中的最小值。
語(yǔ)法
min()方法語(yǔ)法:
min(list)
參數(shù)
- list -- 要返回最小值的列表。
返回值
返回列表元素中的最小值。
實(shí)例
以下實(shí)例展示了 min()函數(shù)的使用方法:
#!/usr/bin/python3
list1, list2 = ['Google', 'W3CSchool', 'Taobao'], [456, 700, 200]
print ("list1 最小元素值 : ", min(list1))
print ("list2 最小元素值 : ", min(list2))
以上實(shí)例輸出結(jié)果如下:
list1 最小元素值 : Google
list2 最小元素值 : 200
更多建議: