Given a nested list, such as
my_list = ['A', 'B', ['C', ['D', 'E'], 'F'], 'G']
Is there a way I can read the list level of each element, and return it such that:
new_list = [('A', 0), ('B', 0), [('C', 1), [('D', 2), ('E', 2)], ('F', 1)], ('G', 0)]
Any help or suggestions are greatly appreciated.