how to check if a character in a string is a digit or letter python code example
Example 1: python check if character is letter
>>> 'A'.isalpha()
True
>>> '1'.isalpha()
False
Example 2: test if character is number python string
>>> 'A'.isdigit()
False
>>> '1'.isdigit()
True