第一种方式(zip):
list1 = ["mo","deng","ge"] list2 = [1,2,3] l = list(zip(list1,list2)) print(l)
第二种方式(for):
list1 = ["mo","deng","ge"] list2 = [1,2,3] l = [] for i in range(len(list1)): l.append((list1[i],list2[i])) print(l)
结果:
[('mo', 1), ('deng', 2), ('ge', 3)]