fork download
  1. dicionario = {
  2. (0,0,0): ['0, 0, 0'],
  3. (0,0,1): ['0, 0, 1'],
  4. (0,0,2): ['0, 0, 2'],
  5. (0,0,5): ['0, 0, 5'],
  6. (0,1,0): ['0, 1, 0']
  7. }
  8.  
  9. indices = sorted(dicionario.keys(), key = lambda item: item[2])
  10.  
  11. for i in indices:
  12. print(i, dicionario[i])
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
(0, 1, 0) ['0, 1, 0']
(0, 0, 0) ['0, 0, 0']
(0, 0, 1) ['0, 0, 1']
(0, 0, 2) ['0, 0, 2']
(0, 0, 5) ['0, 0, 5']