Python nested list within a nested list without looping
I want to add a dictionary to a nested list within a nested list.
so;
['master_list 1', ['list 1', ['sub_list 1']], ['list 2'], ['list 3']]
would end up like;
['master_list_1', ['list_1', ['sub_list_1',{key_1:value_1}]], ['list_2'], ['list_3']]
I know the exact position within the lists that I want to add the dictionary, so can I add the dictionary without looping through other lists?
I have got开发者_如何转开发 as far as
master_list[0].append(list_1)
but I can't find out how to call the lower lists.
master_list[1][1].append({key_1:value_1})
精彩评论