I have multiple lists. I want to run a for-loop on the items of each list
Attempt 1
foo = ["today", "tomorrow", "yesterday"]
bar = ["What", "is", "chocolate"]
empty = []
for x in [foo, bar]:
empty.append("mushroom" + x)
Runtime error
Traceback (most recent call last):
File "<string>", line 2, in <module>
TypeError: cannot concatenate 'str' and 'list' objects
Attempt 2
foo = ["today", "tomorrow", "yesterday"]
bar = ["What", "is", "chocolate"]
def shroom(x):
print("mushroom" + x)
map(shroom, bar, foo)
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: shroom() takes exactly 1 argument (2 given)
My desired output would be two new variables, where each element in each list to have "mushroom" appended on.
fooMushroom = [mushroomtoday, mushroomtomorrow, mushroomyesterday]
fooBar = [mushroomWhat,mushroomis,mushroomchocolate]
Note: I do not want pairs using Zip
i.e., I do not want each element from each list to be paired, via zip or a similar function. I need the output of foo and bar to be saved in a variable seperately, not merged/paired.