str.isalpha() Letters only
Last updated: 2026-09-22
str.isalpha() Letters only
str.isalpha() returns True if every char is alphabetic and the string is non-empty.
| Category | String Methods |
|---|---|
| Kind | Built-in Type Method |
| Python Version | all |
📝 Syntax
str.isalpha()
Returns:bool. True if the string is non-empty and every char is alphabetic.
Mutates the original:No (returns a new object)
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
True
False
💡 Related Cases
More case studies coming soon — check back later.
❓ FAQ
QWhat is returned for an empty string or pure digits?
ABoth are False. isalpha() requires non-empty input where every character is a letter, so '123' and '' both return False.
QAre Chinese characters "letters"?
AYes. '你好'.isalpha() returns True because Chinese characters belong to the Unicode letter category. For a pure-English check, combine it with isascii().
QWhat about a string containing spaces?
A'hello world'.isalpha() returns False, because a space is not a letter.