Python String isalpha() Method
The Python isalpha() method detects whether a string consists of only letters or words.
Python String isalpha() Syntax
isalpha() method syntax.
str.isalpha()
Python String isalpha() Parameters
- None.
Python String isalpha() Return Value
Returns True if the string has at least one character and all characters are letters or words, otherwise returns False.
Python String isalpha() Example#1
The following example shows an instance of the isalpha() method.
string = 'apidemos'
print(string.isalpha())
string = 'apidemos2022'
print(string.isalpha())
string = 'Api Demos'
print( string.isalpha())
Output: