You can use str.isalpha().

For example:

s = 'a123b'

for char in s:
    print(char, char.isalpha())

Output:

a True
1 False
2 False
3 False
b True
Answer from rainer on Stack Overflow
🌐
W3Schools
w3schools.com › python › ref_string_isalpha.asp
Python String isalpha() Method
The isalpha() method returns True if all the characters are alphabet letters (a-z). Example of characters that are not alphabet letters: (space)!#%&? etc. ... No parameters. Check if all the characters in the text is alphabetic:
🌐
Codecademy
codecademy.com › docs › python › strings › .isalpha()
Python | Strings | .isalpha() | Codecademy
October 9, 2023 - 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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string-isalpha-method
Python String isalpha() Method - GeeksforGeeks
October 3, 2025 - The isalpha() method checks if all characters in a given string are alphabetic.
🌐
Scaler
scaler.com › home › topics › isalpha() in python
isalpha() in Python - Scaler Topics
April 7, 2024 - The isalpha() function is a built-in function used for string handling in python, which checks if the single input character is an alphabet or if all the characters in the input string are alphabets.
🌐
TutorialsPoint
tutorialspoint.com › how-do-i-check-if-a-string-has-alphabets-or-numbers-in-python
How do I check if a string has alphabets or numbers in Python?
September 2, 2025 - To check if a string contains at least one letter or one digit, you can use a loop to go through each character or apply regular expressions. This is helpful when strings may contain a mix of character types. In this example, we check for the presence of at least one letter or number using a loop and the any() function - text = "abc123!" has_alpha = any(c.isalpha() for c in text) has_digit = any(c.isdigit() for c in text) print("Contains alphabet:", has_alpha) print("Contains digit:", has_digit)
🌐
Vultr Docs
docs.vultr.com › python › standard-library › str › isalpha
Python str isalpha() - Check Alphabetic Characters | Vultr Docs
November 26, 2024 - The isalpha() method in Python's string class is a straightforward yet powerful tool for checking whether a string contains only alphabetic characters. This method returns True if all characters in the string are alphabetic (i.e., they are part ...
🌐
Quora
quora.com › How-do-you-check-if-the-given-character-is-an-alphabet-in-Python
How to check if the given character is an alphabet in Python - Quora
Originally Answered: How do you check if a character is a letter in Python? · ... The isalpha() method uses whether the character is marked as a letter in the Unicode database - so this means it will deal with international character sets too.
Find elsewhere
🌐
PREP INSTA
prepinsta.com › home › python program › python program to check whether a character is an alphabet or not
Character is alphabet or not in python | Programming | PrepInsta
October 13, 2022 - # Python Program to find character is alphabet or not # user input ch = 'z' # basic logic if 'a' <= ch <= 'z' or 'A' <= ch <= 'Z': print("The character", ch, "is an Alphabet") else: print("The character", ch, "is not an Alphabet")
🌐
LabEx
labex.io › tutorials › python-how-to-check-if-a-character-is-a-letter-in-python-559499
How to Check If a Character Is a Letter in Python | LabEx
In this lab, you learned how to use the isalpha() method in Python to check if all characters in a string are letters. You created a letter_check.py file and experimented with different strings, including those containing only letters, letters ...
🌐
CodeScracker
codescracker.com › python › program › python-program-check-alphabet.htm
Python Program to Check Alphabet or Not
This program does the same job as of previous program, but using a user-defined function named checkAlphabet(). This function receives the character entered by user as its argument and returns 1, if it is an alphabet, otherwise returns 2.
🌐
Tutorial Gateway
tutorialgateway.org › python-program-to-check-character-is-alphabet-or-not
Python Program to check character is Alphabet or not
April 7, 2025 - ch = input("Please Enter Your Own Character : ") if((ch >= 'a' and ch <= 'z') or (ch >= 'A' and ch <= 'Z')): print("The Given Character ", ch, "is an Alphabet") else: print("The Given Character ", ch, "is Not an Alphabet") Checking whether the ...
🌐
Know Program
knowprogram.com › home › python program to check whether character is alphabet
Python Program to Check Whether Character is Alphabet
April 24, 2021 - # Python program to check whether ... check charater is alphabet or not if((ch>='a' and ch<= 'z') or (ch>='A' and ch<='Z')): print(ch, "is an Alphabet.") else: print(ch, "is not an Alphabet.")...
🌐
TutorialsPoint
tutorialspoint.com › article › How-to-check-if-a-character-in-a-string-is-a-letter-in-Python
How to check if a character in a string is a letter in Python?
March 25, 2025 - import string text = "Hello World" index = 1 if text[index] in string.ascii_letters: print(f"The character '{text[index]}' at index {index} is a letter") else: print(f"The character '{text[index]}' at index {index} is not a letter") ... Regular ...
🌐
YouTube
youtube.com › watch
Check If String Contains Any Letters from Alphabet in Python (Example) | any() & isalpha() Functions - YouTube
How to test whether a character string contains one or multiple alphabetical letters in the Python programming language. More details: https://statisticsglob...
Published   March 17, 2023
🌐
Programiz
programiz.com › python-programming › methods › string › isalpha
Python String isalpha()
name = "MonicaGeller" if name.isalpha() == True: print("All characters are alphabets") else: print("All characters are not alphabets.")
🌐
Note.nkmk.me
note.nkmk.me › home › python
Check If a String Is Numeric, Alphabetic, Alphanumeric, or Ascii | note.nkmk.me
May 19, 2023 - The isalpha() method determines if all characters in the string belong to the alphabetic category, i.e., those with a Unicode character database general category property of Lm, Lt, Lu, Ll, or Lo.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-test-if-string-contains-alphabets-and-spaces
Test if String Contains Alphabets and Spaces - Python - GeeksforGeeks
July 12, 2025 - This method iterates through each character in the string, checking whether all characters are either alphabets (isalpha()) or spaces (isspace()) and the all() function ensures the condition holds true for the entire string. ... s = "geeksforgeeks is best for geeks" # Check if all characters are alphabets or spaces res = s != '' and all(c.isalpha() or c.isspace() for c in s) print("Does the string contain only alphabets and spaces:", res)
🌐
GeeksforGeeks
geeksforgeeks.org › python-string-isalpha-application
Python String isalpha() and its application - GeeksforGeeks
April 1, 2020 - In Python, isalpha() is a built-in method used for string handling. The isalpha() methods returns “True” if all characters in the string are alphabets, Otherwise, It returns “False”. This function is used to check if the argument includes ...
🌐
Stack Overflow
stackoverflow.com › questions › 73310311 › check-whether-a-character-is-an-alphabet-digit-or-special-character-python
if statement - Check whether a character is an alphabet, digit or special character- PYTHON - Stack Overflow
You could also utilize Python's String methods isalpha() and isnumeric(). def get_char(): """ Prompt user for character input, or exit if user enters more than a single character.