Advertisement
horozov86

Student Academy

Mar 20th, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. dictionary = {}
  2.  
  3. count = int(input())
  4.  
  5. for _ in range(count):
  6.     student_name = input()
  7.     grade = float(input())
  8.  
  9.     if student_name not in dictionary:
  10.         dictionary[student_name] = []
  11.     dictionary[student_name].append(grade)
  12.  
  13. for student, grade in dictionary.items():
  14.     if sum(grade) / len(grade) >= 4.50:
  15.         average_grade = sum(grade) / len(grade)
  16.         print(f"{student} -> {average_grade:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement