fork(2) download
  1. # your code goes here
  2. lista = [('Thiago', 30, 9.0), ('Maria', 28, 7.0), ('Ana', 30, 9.0)]
  3. ordered = sorted(lista, key=lambda x: (x[2], x[1], x[0]))
  4. print(ordered)
Success #stdin #stdout 0.02s 9284KB
stdin
Standard input is empty
stdout
[('Maria', 28, 7.0), ('Ana', 30, 9.0), ('Thiago', 30, 9.0)]