Добавить кортеж в словарь питона
from collections import defaultdict
d = defaultdict(list)
d[i].append((left, right))
Ghaith Alzin
from collections import defaultdict
d = defaultdict(list)
d[i].append((left, right))