THE WORLD'S LARGEST WEB DEVELOPER SITE

Python String isalpha() Method

❮ String Methods


Example

Check if all the characters in the text are letters:

txt = "CompanyX"

x = txt.isalpha()

print(x)
Run example »

Definition and Usage

The isalpha() method returns True if all the characters are alphabet letters (a-z).

Example of characters that are not alphabet letters: (space)!#%&? etc.


Syntax

string.isalpha()

Parameter Values

No parameters.


More Examples

Example

Check if all the characters in the text is alphabetic:

txt = "Company10"

x = txt.isalpha()

print(x)
Run example »

❮ String Methods