Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- students_count = int(input())
- students_list = {}
- for student in range(students_count):
- name, grade = tuple(input().split())
- grade = float(grade)
- if name not in students_list:
- students_list[name] = []
- students_list[name].append(grade)
- for key, value in students_list.items():
- print(f"{key} -> " + ' '.join([f"{grade:.2f}" for grade in value]) + f" (avg: {(sum(value) / len(value)):.2f})")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement