Latest web development tutorials

Python3 min()方法

Python3 字符串 Python3字符串


描述

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

語法

min()方法語法:

min(str)

參數

  • str -- 字符串。

返回值

返回字符串中最小的字母。

實例

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

#!/usr/bin/python3

str = "w3big";
print ("最小字符: " + min(str));

以上實例輸出結果如下:

最小字符: b

Python3 字符串 Python3字符串