max(str)

Python 字符串 Python 字符串

描述

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

语法

max()方法语法:

max(str)
wζ3ζxζuζe.com提供本在线速查手册,请勿盗用!

参数

返回值

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

实例

以下实例展示了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);
wζ3ζxζuζe.com提供本在线速查手册,请勿盗用!

以上实例输出结果如下:

Max character: y
Max character: x
wζ3ζxζuζe.com提供本在线速查手册,请勿盗用!

Python 字符串 Python 字符串