2017-11-12から1日間の記事一覧
Pythonでcollection型のソートにはOrderedDicを使う。 >>> from collections import OrderedDict >>> # regular unsorted dictionary >>> d = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2} >>> # dictionary sorted by key >>> OrderedDict(sorted(d.…