Latest web development tutorials

Pythonのはisalpha()メソッド

Python文字列 Python文字列


説明

Pythonのはisalpha文字列を検出するために()メソッドは文字のみで構成されています。

文法

isalpha()メソッドの構文:

str.isalpha()

パラメータ

  • なし。

戻り値

少なくとも一つの文字列と、すべての文字が文字があるされている場合、それはそうでなければFalse、Trueを返します

次の例では、はisalpha()インスタンスメソッドを示しています。

#!/usr/bin/python

str = "this";  # No space & digit in this string
print str.isalpha();

str = "this is string example....wow!!!";
print str.isalpha();

次のように上記の出力結果の例は次のとおりです。

True
False

Python文字列 Python文字列