Are you trying to achieve something like this?
def inputInt(acceptAny):
while True:
try :
value = input (' Enter a value:')
value = int(value)
except ValueError:
if acceptAny:
break
else:
print ('Invalid input - Try again')
continue
break
return value
if __name__ == "__main__":
number = inputInt(False)
print ('The value is',number)