fork download
  1. from itertools import product, chain
  2. from collections import OrderedDict
  3.  
  4. a = [[2,5,6], [1,8,2], [2,5,9]]
  5. x = OrderedDict(zip(product(range(1,4), repeat=2), chain(*a)))
  6.  
  7. print(x)
  8.  
Success #stdin #stdout 0.01s 10384KB
stdin
Standard input is empty
stdout
OrderedDict([((1, 1), 2), ((1, 2), 5), ((1, 3), 6), ((2, 1), 1), ((2, 2), 8), ((2, 3), 2), ((3, 1), 2), ((3, 2), 5), ((3, 3), 9)])