Create a list of tuples from two nested lists
问题 Having a list A with an arbitrary degree of nesting, and a list B with a nesting structure equivalent to that of A ( or deeper ), how can we create a list of tuples for all corresponding elements? For example: A = ['a', ['b', ['c', 'd']], 'e'] B = [1, [2, [3, [4, 5]]], 6] >>> [('a', 1), ('b', 2), ('c', 3), ('d', [4, 5]), ('e', 6)] 回答1: Basically, all you need to do is, iterate a and b simultaneously and return the values of a and b , if the current element of a is not a list. Since your