1514a0b
1
2
3
4
5
6
7
from collections import defaultdict def grouping_dictionary(l): d = defaultdict(list) for k, v in l: d[k].append(v) return d