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