1>>> def hasNumbers(inputString):
2... return any(char.isdigit() for char in inputString)
3...
4>>> hasNumbers("I own 1 dog")
5True
6>>> hasNumbers("I own no dog")
7False
1def RepresentsInt(s):
2 try:
3 int(s)
4 return True
5 except ValueError:
6 return False