目录

max(str)

描述 (Description)

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

语法 (Syntax)

以下是max()方法的语法 -

max(str)

参数 (Parameters)

  • str - 这是需要返回最大字母字符的字符串。

返回值 (Return Value)

此方法返回字符串str中的最大字母字符。

例子 (Example)

以下示例显示了max()方法的用法。

#!/usr/bin/python
str = "this is really a string example....wow!!!";
print "Max character: " + max(str)
str = "this is a string example....wow!!!";
print "Max character: " + max(str)

当我们运行上面的程序时,它产生以下结果 -

Max character: y
Max character: x
↑回到顶部↑
WIKI教程 @2018