string = 'this string has digits 12345'
if any(char.isdigit() for char in string):
#digits found
print('"{}" has digits!'.format(string))
else:
#digits NOT found
print('"{}" does NOT have digits!'.format(string))
s = 'some string'
numbers = sum(c.isdigit() for c in s)
letters = sum(c.isalpha() for c in s)
spaces = sum(c.isspace() for c in s)
others = len(s) - numbers - letters - spaces
for number in numbers:
if '4' in str(number):
print('{} True'.format(number))
else:
print("False")
s = set(str(4059304593))
print('2' in s)