Elektrine lite

← Feed

@darkling@mstdn.social

Post #4332499

2026-08-01 10:19 UTC

@simontatham@hachyderm.io You can do this simply and non-recursively with something like: result = values[0] for v in values[1:]: result = cross_product(result, v) def cross_product(xs, ys): result=[] for x in xs: for y in ys: result.append(x+[y]) return result But the recursive version is probably a bit more obvious.

Replies (0)

No replies.