check whether character is digit python code example
Example 1: test if character is number python string
>>> 'A'.isdigit()
False
>>> '1'.isdigit()
True
Example 2: isdigit python
s='12'
s.isdigit()#returns True
>>> 'A'.isdigit()
False
>>> '1'.isdigit()
True
s='12'
s.isdigit()#returns True