69pao国产精品视频-久久精品一区二区二三区-精品国产精品亚洲一本大道-99国产综合一区久久

Python max()方法

Python max()方法

Python 字符串Python 字符串

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

 

語法

max()方法語法:

max(str)

 

參數(shù)

  • str -- 字符串。

 

返回值

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

 

實例

以下實例展示了max()函數(shù)的使用方法:

#!/usr/bin/python

str = "this is really a string example....wow/b64/";
print "Max character: " + max(str);

str = "this is a string example....wow/b64/";
print "Max character: " + max(str);

以上實例輸出結(jié)果如下:

Max character: y
Max character: x

Python 字符串Python 字符串

下一節(jié):Python min()方法

Python 教程

相關(guān)文章