欢迎您 本站地址:  
返回首页   返回编程教学   看图猜一猜  蜘蛛纸牌  动物音效  会记类书籍  数学练习  周朝历史  学习Lua  学习SQL 

Python max()方法

Python 字符串 Python 字符串


描述

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

语法

max()方法语法:

max(str)

参数

返回值

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

实例

以下实例展示了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

Python 字符串 Python 字符串

小库提示

扫描下方二维码,访问手机版。