I want to know how to output the name, not the values, of each index (and sub-index) in a list and in sub-lists.
For example, let's say I have a main list, which has 3 other lists each containing 5 sub-lists. Here is a small example to clarify:
List1 = [SubList1, SubList2, SubList3, SubList4, SubList5]
List2 = [Apple, Banana, Orange, Pear, Grape]
List3 = [Red, Yellow, Orange, Green, Purple]
Lists = [List1, List2, List3]
MainList = [Lists]
How can I print out 'List1'?
When I type in
MainList[0][0]
it outputs
[SubList1, SubList2, ..., Sublist5]
I want the actual name of the index, not its values.
I thought about using dictionary keys, but the report generator that I am using for the XML conversion outputs all the data into lists. Does this mean I have no choice but to modify my report generator script to output the data into dictionaries?