Latest web development tutorials

Python3 max()方法

Python3 字符串 Python3字符串


描述

max() 方法返回字符串中最大的字母。

語法

max()方法語法:

max(str)

參數

  • str -- 字符串。

返回值

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

實例

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

#!/usr/bin/python3

str = "w3big"
print ("最大字符: " + max(str))

以上實例輸出結果如下:

最大字符: u

Python3 字符串 Python3字符串