Python min()方法
描述
Python min() 方法返回字串中最小的字母。
語法
min()方法語法:
min(str)
參數
- str -- 字串。
返回值
返回字串中最小的字母。
實例
以下實例展示了min()函數的使用方法:
#!/usr/bin/python str = "this-is-real-string-example....wow!!!"; print "Min character: " + min(str); str = "this-is-a-string-example....wow!!!"; print "Min character: " + min(str);
以上實例輸出結果如下:
Min character: ! Min character: !