def nest(*iterables):
    "Iterate over the iterables as if they were nested in loops."
    return _nest(list(map(tuple, reversed(iterables))))
Iterate over the iterables as if they were nested in loops.
recipes/Python/578046_Easily_Write_Nested_Loops/recipe-578046.py