from collections import OrderedDict
dicionario = {
(0,0,0): ['0, 0, 0'],
(0,0,1): ['0, 0, 1'],
(0,0,2): ['0, 0, 2'],
(0,0,5): ['0, 0, 5'],
(0,1,0): ['0, 1, 0']
}
novo_dicionario = OrderedDict(sorted(dicionario.items(), key=lambda item: item[0][2]))
for key, value in novo_dicionario.items():
print(key, value)
ZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgT3JkZXJlZERpY3QKCmRpY2lvbmFyaW8gPSB7CiAgICAoMCwwLDApOiBbJzAsIDAsIDAnXSwKICAgICgwLDAsMSk6IFsnMCwgMCwgMSddLAogICAgKDAsMCwyKTogWycwLCAwLCAyJ10sCiAgICAoMCwwLDUpOiBbJzAsIDAsIDUnXSwKICAgICgwLDEsMCk6IFsnMCwgMSwgMCddCn0KCm5vdm9fZGljaW9uYXJpbyA9IE9yZGVyZWREaWN0KHNvcnRlZChkaWNpb25hcmlvLml0ZW1zKCksIGtleT1sYW1iZGEgaXRlbTogaXRlbVswXVsyXSkpCgpmb3Iga2V5LCB2YWx1ZSBpbiBub3ZvX2RpY2lvbmFyaW8uaXRlbXMoKToKICAgIHByaW50KGtleSwgdmFsdWUp
(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']