I am attempting to create a basic program which requests a numeric value from the user.
If the value is between .5 and 1 the program should print "good".
If the value is between 0 to 0.49 the output states "fair".
If the numeric input the user provides is outside of 0 to 1 it states: "try again".
If the input cannot be converted to a number it states: "Invalid input".
Here is what I have got so far:
val=abs(1)
while True:
num = raw_input("Enter a number: ")
if num == "val" : break
print 'try again between 0 to 1'
try:
num = float(num)
except:
print "Invalid input"
if .5 < num < 1:
print 'Good'
if 0 < num < .49:
print 'Fair'