You want to do something when it is not a digit
https://www.python.org/dev/peps/pep-0008/
def is_it_digit(inptUser): for x in inptUser: if not x.isdigit(): print('a not digit found') return False print(' The input is full of digits ') return True inptUser = input('Please enter a variable : ') print(inptUser) print(is_it_digit(inptUser))And when you have some time, take a look at the Python Style Guide; variables are lower_case_with_underscores
https://www.python.org/dev/peps/pep-0008/