Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. f = open('task.txt', 'r')
  2. n = {}
  3. for line in f:
  4.     string = line.split()
  5.     average = (int(string[3]) + int(string[4]) + int(string[5])) / 3
  6.     date = string[2].split('.')
  7.     string[1] += " |"
  8.     string[2] += " |"
  9.     string[3] += " " + string[4] + " " + string[5] + " ->" + str(average)
  10.     string[5] = ""
  11.     string[4] = str(int(date[0]) + int(date[1]) * 30 + int(date[2]) * 360)
  12.     j = string[4]
  13.     n[j] = string
  14. for key in sorted(n.keys(), reverse = True):
  15.     print(n[key])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement