0
How to solve this problem of 'if statement'
The result I want to get in python screen is that If a score (using 'raw_input operator) is between 0.0 and 1.0 , it print out 'A ' Otherwise print out 'Error.' Ex) Enter score: 0.95 A Enter score: 10.0 Error Please help me out I have been solving problems on Textbook (author is Dr.Chuck.)
2 Answers
+ 1
try to convert your 'score' to float instead of an integer.
score = float(raw_input())
if (score <1) and (0< score):
print 'A'
else:
print 'error'
0
Thank you :)