Suppose there are 3 lists:
l_1 = ['a', 'b', 'c']
l_2 = ['d', 'e', 'f']
l_index = ['l_1', 'l_2']
So l_index contains names of 2 other lists. I want first to select a list by randomness, for which I can use:
import random
selected_list = random.choice(l_index)
Then I need to select an element in that list, also by randomness. However this doesn't work:
selected_element = random.choice(selected_list)
It's because selected_list is treated as a string. How can I make python refer to it as a list instead?