Python字符串方法max()返回字符串字符串的最大字母字符。
max(str)
str - 这是需要返回的最大字母字符的字符串。
此方法返回字符串中的最大字母字符。
链接:https://www.learnfk.comhttps://www.learnfk.com/python/string-max.html
来源:LearnFk无涯教程网
以下示例显示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
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)