Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 11th, 2012  |  syntax: Python  |  size: 0.33 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def computegrade(score):
  2.     if(float(score)>=1.0 or float(score)<=0.0):
  3.         return 'Bad Score'
  4.     if float(score)==0.9:
  5.         return 'A'
  6.     elif float(score)==0.8:
  7.         return 'B'
  8.     elif float(score)==0.7:
  9.         return 'C'
  10.     elif float(score)==0.6:
  11.         return 'D'
  12.     elif float(score)<0.6:
  13.         return 'F'