Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Thanks this works perfect! I added: all_combs.append(list(chain.from_iterable(comb))) to chain the lists within the combination tuples. Commented Jun 10, 2021 at 12:35
  • Only one thing does not yet work as how I would like to see it. It is able to return combinations with 1 and 4. However, in my case integers that are from the same sublist cannot occur together in a combination. Commented Jun 10, 2021 at 12:43