python check if only numbers in string 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: how to check if digit in int python
s = set(str(4059304593))
print('2' in s)