Python - String Method - isalpha() Tutorial
The isalpha() method returns True if all characters in the string are alphabets. otherwise, it returns False.
Syntax-
String.isalpha()
Example-
#contain white space also
str1 = "Hello Sam"
print(str1.isalpha())
#contain only alphabet
str2 = "HelloSam"
print(str2.isalpha())
Output-
False
True