Source
x = {'a': 1, 'b': 2, 'd': 3, 'c': 4} d = list(x.keys()) for key in sorted(d): print(key + '=>' + d[key]) Mistake
Traceback (most recent call last): File "C:/Python projects/qq.py", line 4, in <module> print(key + '=>' + d[key]) TypeError: list indices must be integers or slices, not str Read Mark Lutz - Python, 5th Edition and ran into a small problem. I use python 3.6.
{}among the editor’s buttons or Ctrl-K on the keyboard - mymedia