Latest web development tutorials

Pythonの最大()メソッド

Python文字列 Python文字列


説明

Pythonの最大()メソッドは、最大の文字で文字列を返します。

文法

最大()メソッドの構文:

max(str)

パラメータ

  • STR - 文字列。

戻り値

最大の文字の文字列を返します。

次の例では、使用する最大()関数を示しています。

#!/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文字列