Python max()方法
描述
Python max() 方法返回字串中最大的字母。
語法
max()方法語法:
max(str)
參數
- 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