isalpha

Description

Returns a Boolean stating whether the string contains only letters.

Syntax

str. isalpha()

Return Value

bool

Time Complexity

#TODO

Remarks

For 8-bit strings, this method is locale-dependent. Returns False if string is empty.

Example

>>> ''.isalpha()
False
>>> 'abc123'.isalpha()
False
>>> 'abc'.isalpha()
True
>>> '123'.isalpha()
False
>>> 'Abc'.isalpha()
True
>>> '!@#'.isalpha()
False
>>> '   '.isalpha()
False
>>> 'ABC'.isalpha()
True