Python3 min()方法

Python3 字串 Python3 字串


描述

Python min() 方法返回字串中最小的字母。

語法

min()方法語法:

min(str)

參數

  • str -- 字串。

返回值

返回字串中最小的字母。

實例

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

實例

#!/usr/bin/python3

str = "zaixian";
print ("最小字元: " + min(str));

以上實例輸出結果如下:

最小字元: b

Python3 字串 Python3 字串