慕码人2483693
A = [0, 0, 1, 0, 1, 3, 4, 3]B = [1, 2, 1, 3, 4, 1, 2, 3]joined = [{a:b} for a, b in zip(A, B)] # list of dictsprint(joined)输出:[{0: 1}, {0: 2}, {1: 1}, {0: 3}, {1: 4}, {3: 1}, {4: 2}, {3: 3}]或者,也许:joined = list(zip(A, B)) # list of tuplesprint(joined)输出:[(0, 1), (0, 2), (1, 1), (0, 3), (1, 4), (3, 1), (4, 2), (3, 3)]