May-27-2020, 08:00 AM
It's better to be specific as to what problem is
while True : score = input('Number between 0 and 1\n') try : score = float(score) if 0 <= score <= 1: break else: print('Number must be between 0 and 1, inclusive. Please try again...') except ValueError: print('Not a number. Please try again...') print(f'You entered: {score}')Now, if you want to go a step further you can put [part of] this code in a function that takes start and or end argument, ask user for input, validates it and returns the number once correct input.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs