Python String isalpha() Method
The isalpha() method is a string method that returns True if all the characters in the string are alphabetic letters (a-z).
For example:
name = "Alice"
print(name.isalpha())
# prints True
The method returns False if the string contains any non-alphabetic characters, such as spaces, numbers, punctuation marks, symbols, etc.
For example:
name = "Alice 123"
print(name.isalpha())
# prints False
If you have any questions about this code, you can drop a line in comment.
Comments
Post a Comment