Advertisement
AlexG2230954

ДЗ. Задание 5

May 21st, 2022
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. from collections import defaultdict
  2.  
  3.  
  4. file = open("input.txt", "r", encoding="utf-8")
  5. max_scores = defaultdict(int)
  6.  
  7. for line in file:
  8.     class_number, score = map(int, line.split()[2:])
  9.     max_scores[class_number] = max(max_scores[class_number], score)
  10.  
  11. file.close()
  12. print(max_scores[9], max_scores[10], max_scores[11])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement