Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dictionary = {}
- count = int(input())
- for _ in range(count):
- student_name = input()
- grade = float(input())
- if student_name not in dictionary:
- dictionary[student_name] = []
- dictionary[student_name].append(grade)
- for student, grade in dictionary.items():
- if sum(grade) / len(grade) >= 4.50:
- average_grade = sum(grade) / len(grade)
- print(f"{student} -> {average_grade:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement