Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. inp = raw_input('Please give score between 0.0 and 1.0: ')
  2. try:
  3. finp = float(inp)
  4. except:
  5. finp = -1
  6. if finp >= 0.0 and finp <= 1.0 :
  7. score = finp
  8. else:
  9. print 'Error, please insert valid score'
  10. quit()
  11.  
  12. if score >= 0.9 :
  13. print 'A'
  14. elif score >= 0.8 :
  15. print 'B'
  16. elif score >= 0.7 :
  17. print 'C'
  18. elif score >= 0.6 :
  19. print 'D'
  20. elif score < 0.6 :
  21. print 'F'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement