yeah568

/g/ for mike

May 3rd, 2013
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. grade = raw_input("Please enter the letter grade. \n")
  2. whole_grades = {"A":4.0, "B":3.0, "C":2.0, "D":1.0, "F":0.0}
  3. signs = {"+":0.3, "-":-0.3}
  4. if len(grade) == 1:
  5.     print(whole_grades[grade])
  6. elif len(grade) == 2:
  7.     a = list(grade)
  8.     numerical_grade = whole_grades[a[0]]
  9.     numerical_grade += signs[a[1]]
  10.     print(numerical_grade)
  11. else:
  12.     print("YOU HAVE FUCKED UP NOW")
RAW Paste Data