Skip to content

Latest commit

 

History

History
54 lines (46 loc) · 918 Bytes

File metadata and controls

54 lines (46 loc) · 918 Bytes

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

See Also

isalnum(), isalpha(), isdigit(), islower(), isspace(), istitle(), isupper()