Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if string has digits python

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))
 
PREVIOUS NEXT
Tagged: #check #string #digits #python
ADD COMMENT
Topic
Name
8+4 =