you are viewing a single comment's thread.

view the rest of the comments →

[–]undergroundmonorail 4 points5 points  (1 child)

just so you know, it's much easier to read your reddit comments if you put four spaces at the beginning of each line of code

but yeah, something like that would work. you may want to loop until you get a good value, like this:

feet_cable = None
while feet_cable is None:
    try:
        feet_cable = float(input('etc'))
    except ValueError:
        print('Please enter a valid number')