Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python String isalpha() method is used to check whether all characters of the string are alphabets or not. It returns true when all characters of the string is alphabets, else returns false. Alphabet characters belongs to letters A - Z (both uppercase and lowercase).

Syntax

string.isalpha()

Parameters

No parameter is required.

Return Value

Returns True if all characters of the specified string are alphabet, else returns False.

Example:

In the below example, isalpha() method to used to check whether all characters of the string are alphabets or not.

MyString = "Hello World!"
print(MyString.isalpha())

MyString = "HelloWorld"
print(MyString.isalpha())

The output of the above code will be:

False   

True    

❮ Python String Methods