d = {(0, 1): 'X', (2, 3): 'O'}
for x, y in d:
print(x, y, d[x, y])
from functools import reduce
class CustomDict(dict):
def __getitem__(self, key):
return reduce(lambda acc, x: acc.__getitem__(x), key.split('.'), super())
data = CustomDict({'a': {'b': {'c': 1}}})
print(data['a.b.c'])