.isalpha()
rclarkeweb7 total contributions
Published Oct 9, 2023
Contribute to Docs
The .isalpha()
string method checks if all of the characters in a string are letters of the alphabet (a-z
). The letters can be lowercase or uppercase. If the string only contains letters of the alphabet it returns True
, otherwise it returns False
. Whitespace, numbers, and symbols are not considered to be part of the alphabet.
Syntax
my_string.isalpha()
The .isalpha()
method doesn’t have any parameters.
Example
The following example uses .isalpha()
to check str
:
str = "Coding123"print(str.isalpha())
This example will output:
False
Codebyte Example
The following code is runnable and uses .isalpha()
to check several strings:
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.