how to check if a string containts digits python code example
Example 1: python how to check if string contains only numbers
print("012345".isdecimal())
OUTPUT
True
print("a12345".isdecimal())
OUTPUT
False
Example 2: test if character is number python string
>>> 'A'.isdigit()
False
>>> '1'.isdigit()
True