这篇教程Python max()方法写得很实用,希望能帮到您。 描述Python max() 方法返回字符串中最大的字母。 语法max()方法语法: max(str) 参数返回值返回字符串中最大的字母。 实例以下实例展示了max()函数的使用方法: #!/usr/bin/pythonstr = "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: yMax character: x Python maketrans()方法 Python min()方法 |