I have the code:
user_input = input('>>>: ')
if not re.search('[0-9]', user_input):
print('That wasn\'t an integer.')
else:
print('That was an integer!')
print(user_input)
It basically tries to determine if the user's input is (mathematically) an integer or not. This works if the input is 'adgx'; the code recognizes that these aren't within the range 0-9, and print's 'That wasn't an integer.'. I need the program to print 'That wasn't an integer.' if the input is for example 'a3h1d', but it doesn't. I assume because the input technically contained numbers that were within the range, it satisfied the statement. I need it so that if the input is 'a3h1d' that the program prints 'That wasn't an integer.'.