Python3 字符串 Python3 字符串


描述

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

語法

min()方法語法:

min(str)

參數(shù)

  • str -- 字符串。

返回值

返回字符串中最小的字母。(實(shí)際上是返回ASCII碼較小的值)

實(shí)例

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

#!/usr/bin/python3

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

以上實(shí)例輸出結(jié)果如下:

最小字符: 3

Python3 字符串 Python3 字符串