def in_order_combinations(*lists):
    lists = list(filter(len, lists))
if len(lists) == 0:
    yield []
for lst in lists:
    element = lst.pop()
for combination in in_order_combinations(*lists):
    yield combination + [element]
lst.append(element)
for combo in in_order_combinations(['a', 'b'], [1, 2]):
    pass
Combination of two lists while keeping the order