import collections dict_x = collections.defaultdict(list) ... dict_x[key].append(value)
dict_x = {} ... dict_x.setdefault(key, []).append(value)