zsombi0806

eHazi q/40548

May 7th, 2020 (edited)
696
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def ex():
  2.     li = []
  3.     while True:
  4.         x = input()
  5.         if x == "0":
  6.             break
  7.         else:
  8.             name, age, height = x.split(",")
  9.             age = int(age)
  10.             height = int(height)
  11.             li.append((name, age, height))
  12.  
  13.     li.sort(key = lambda x : (x[0], -x[1], x[2]))
  14.     for i in li:
  15.         print(i[0], i[1], i[2])
  16.  
  17. ex()
Add Comment
Please, Sign In to add comment