Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import defaultdict
- def get_student():
- *student_name, class_number, score = input().split()
- return int(class_number), int(score)
- def get_mid(scores):
- return sum(scores) / len(scores)
- classes = defaultdict(list)
- while True:
- try: class_number, score = get_student()
- except EOFError: break
- classes[class_number].append(score)
- print(*map(get_mid, [classes[9], classes[10], classes[11]]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement