The syntax of isalpha() is:
The isalpha() doesn't take any parameters.
The isalpha() returns:
name = "Monica"
# contains whitespace
name = "Monica Geller"
# contains number
name = "Mo3nicaGell22er"
When you run the program, the output will be:
name = "MonicaGeller"
if name.isalpha() == True:
print("All characters are alphabets")
print("All characters are not alphabets.")
All characters are alphabets
Checkout these related String methods as well: