Advertisement
JkSoftware

Day 9 - Exercise Grading Program

Nov 13th, 2021
715
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. student_scores = {
  2.   "Harry": 81,
  3.   "Ron": 78,
  4.   "Hermione": 99,
  5.   "Draco": 74,
  6.   "Neville": 62,
  7. }
  8. #  Don't change the code above
  9.  
  10. #TODO-1: Create an empty dictionary called student_grades.
  11. student_grades = {}
  12.  
  13. #TODO-2: Write your code below to add the grades to student_grades.
  14. for key in student_scores:
  15.     if student_scores[key] > 90:
  16.         student_grades[key] = "Outstanding"
  17.     elif student_scores[key] > 80:
  18.         student_grades[key] = "Exceeds Expectations"
  19.     elif student_scores[key] > 70:
  20.         student_grades[key] = "Acceptable"
  21.     else:
  22.         student_grades[key] = "Fail"
  23.    
  24.  
  25. # Don't change the code below
  26. print(student_grades)
  27.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement