myVariable = input('Enter a number') if type(myVariable) == int or type(myVariable) == float: # Do something else: print('The variable is not a number')