■
>>> x = {e:ord(e) for e in "ABC"} >>> x {'A': 65, 'C': 67, 'B': 66} >>> for k,v in x.items(): print(k,v) A 65 C 67 B 66 >>> x.items() dict_items([('A', 65), ('C', 67), ('B', 66)]) >>> for k,v in reversed(list(x.items())): print(k,v) B 66 C 67 A 65 >>> for k,v in sorted(list(x.items())):print(k,v) A 65 B 66 C 67
@