inspection

str.isalpha

Returns True if the string is non-empty and every character is an alphabetic Unicode letter. Digits, whitespace, and punctuation all return False.

str.isalpha()

Parameters

Parameter Purpose
self operates on the calling string; takes no arguments
returns bool — False for empty strings

Examples

>>> 'Hello'.isalpha()
True

all letters

>>> 'Hello123'.isalpha()
False

digits disqualify

>>> 'Straße'.isalpha()
True

accented and non-ASCII letters count

>>> ''.isalpha()
False

empty string is False

Gotcha

Spaces make it False — 'Hello World'.isalpha() is False. Empty string is always False.

Related methods

← All Python string methods · Python built-ins