python check if character is number or letter 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