I was looking for some similar code, but it looks like using try/excepts is the best way. Here is the code I'm using. It includes a retry function if the input is invalid. I needed to check if the input was greater than 0 and if so convert it to a float.
def cleanInput(question,retry=False):
inputValue = input("\n\nOnly positive numbers can be entered, please re-enter the value.\n\n{}".format(question)) if retry else input(question)
try:
if float(inputValue) <= 0 : raise ValueError()
else : return(float(inputValue))
except ValueError : return(cleanInput(question,retry=True))
willbefloat = cleanInput("Give me the number: ")