August 2018
Intermediate to advanced
366 pages
10h 14m
English
Proceed with the following steps for this recipe:
>>> from collections import defaultdict >>> rd = defaultdict(list)
>>> for name, num in [('ichi', 1), ('one', 1), ('uno', 1), ('un', 1)]:
... rd[num].append(name)
...
>>> rd
defaultdict(<class 'list'>, {1: ['ichi', 'one', 'uno', 'un']})