I need to see if the user input is a float or not. However, I need the question to keep asking the user to re input until it is a float.
try: float(a) except TypeError: while float(a) != a: a = input(f"'{a}' is not a valid input. Please enter a number: ")
This does not work because I get an error the moment I do float(a) if a is not a float. What should I do to put a try and error inside of a while statement.