Using isdigit for floats?

EAFP

try:
    x = float(a)
except ValueError:
    print("You must enter a number")

Leave a Comment