May-26-2020, 09:00 PM
This may get you closer
while True : score = input('number btw 0 and 1\n') try : score = float(score) if score<=0 or score>=1: raise ValueError except ValueError: print('not number, at least not in range')The part we haven't answered is how to raise an error. This is how. With it you will get an error to trigger the except block whether the person enters "5" or "a".