data = {k: [] for k in range(2)}
from collections import defaultdict data = defaultdict(list) data[1].append('hello')