from itertools import product
lists = [['THE', 'A'], ['ELEPHANT', 'APPLE', 'CAR'], ['WALKED', 'DROVE', 'SAT']
    ]
for items in product(*lists):
    pass
Iterating over an unknown number of nested loops in python