Python String isalpha() Method

❮ String Methods


Example

Check if all the characters in the text are letters:

txt = "CompanyX"

x = txt.isalpha()

print(x)
Try it Yourself »

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)
Try it Yourself »

❮ String Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.