Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = [[1, 2, 3], ['a', 'b', 'c'], ['_1', '_2', '_3'], ['_a', '_b', '_c']]
- def dec(a, b):
- buf = [[]]
- e = 0
- for i in a:
- for j in b:
- if not isinstance(i, list): i = [i]
- if not isinstance(j, list): j = [j]
- buf[e] = i + j
- if not e == len(a) * len(b) - 1:
- buf.append([])
- e += 1
- return buf
- g = dec(t[0], t[1])
- for i in t[2:]:
- g = dec(g, i)
Advertisement
Add Comment
Please, Sign In to add comment