Using a for loop to iterate and concatenate words to create several permutations. My for loop works but I'd rather not use a for loop as I want to have the code on one line so I can create a variable.
What options do I have? Basic question I realize.
Here's the two lists I want to concatenate:
first = ["Happy", "Sad", "Fun"]
second = ["Game", "Movie"]
desired output:
combo = ["Happy Game", "Happy Movie", "Sad Game", "Sad Movie", "Fun Game", "Fun Movie"]
This for loop works but I want it on one line and as a variable:
for b in first:
for s in second:
combo = b + ' ' + s
print(combo)
Is there a way to do this without a for loop?