Python List min()方法
Python List min()方法
min() 方法返回列表元素中的最小值。
語法
min()方法語法:
min(list)
參數(shù)
- list -- 要返回最小值的列表。
返回值
返回列表元素中的最小值。
實(shí)例
以下實(shí)例展示了 min()函數(shù)的使用方法:
#!/usr/bin/python list1, list2 = [123, 'xyz', 'zara', 'abc'], [456, 700, 200] print "min value element : ", min(list1); print "min value element : ", min(list2);
以上實(shí)例輸出結(jié)果如下:
min value element : 123 min value element : 200
相關(guān)文章
- Python 教程
- Python 環(huán)境搭建
- Python pass 語句
- Python OS 文件/目錄方法
- Python 面向?qū)ο?/a>
- Python 網(wǎng)絡(luò)編程
- Python2 與 Python3?? 版本區(qū)別
- Python 算法類
- Python MongoDB 數(shù)據(jù)庫連接 - PyMongo 驅(qū)動(dòng)
- Python abs() 函數(shù)
- Python File close() 方法
- Python File readline() 方法
- Python os.chflags() 方法
- Python os.isatty() 方法
- Python os.rmdir() 方法
- Python os.tmpnam() 方法
- Python os.write() 方法
- Python capitalize()方法
- Python isalpha()方法
- Python lstrip()方法