python initialize dict with empty list values

Solutions on MaxInterview for python initialize dict with empty list values by the best coders in the world

showing results for - "python initialize dict with empty list values"
Prune
15 Jan 2016
1from collections import defaultdict
2data = defaultdict(list)
3data[1].append('hello')
4