I have a list of tuples such as:
bins = [(0, 1500), (0, 1500), (2000, 40000)]
I'd like to flatten it out in a loop, but without one of the elements in every loop.
The expected result should be:
[0, 1500, 2000, 40000] # first loop, first element is not there
[0, 1500, 2000, 40000] # second loop, second element is not there
[0, 1500, 0, 1500] # third loop, last element is not there
To flatten it out, I could use:
from itertools import chain
list(chain.from_iterable(my_iterable))
But I need to find how to get this my_iterable