How do I concatenate two lists together but with different frequencies

Question:

I have two lists, let’s say:

list1 = ["red", "blue", "yellow"]
list2 = ["frog", "lion", "tiger", "ant", "shrew", "bee"]

I want to loop the concatenation of the two lists but I want each value of list1 to concatenate with every value of list2 before moving on to the next value of list1. I.e, results would say red frog, red lion, red tiger, red ant, red shrew, red bee, blue frog, etc.

I can’t figure out how I would stagger the loop.

Asked By: Elsybelsy

||

Answers:

listColourAnimal = []
for colour in list1:
    for animal in list2:
        listColourAnimal.append(colour + ' ' + animal)

print(listColourAnimal)
Answered By: Sachin Patel