Advertisement
Void-voiD

Untitled

Mar 19th, 2023
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | Source Code | 0 0
  1. def func(y):
  2.     return -int(y[2]), y[0], y[1]
  3.  
  4.  
  5. a = open('input.txt', 'r', encoding='utf-8')
  6. data = []
  7. for x in a.readlines():
  8.     x1, x2, x3, x4 = x.split()
  9.     data.append([x1, x2, x4])
  10.  
  11. data.sort(key=func)
  12. for x in data:
  13.     print(*x)
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement