I have a list of variables and each variable in that list contains a list of its own. Here is a little example:
var1 = ['apple', 'orange']
var2 = ['teddy bear', 'turtle']
var3 = ['bmw', 'kia']
var_list = [var1, var2, var3]
Then I want to have a loop that iterates over the lists and then another loop that iterates over the items themselves in the list taken from the initial loop. My first instinct was to do this:
for var in var_list: # to select the variable that I want to access the table of
for items in var: # to select each item inside the list
block of code
but this inevitably resulted in the first loop iterating over the list of the first variable when I intended the code to do that in the second loop.
Any idea on how to have a loop iterate through a list of variables, and then a second nested loop to iterate through that variable's items?