dict={}
for x in zip(listA,listB):
if x[0] in dict:
dict[x[0]] += x[1]
else:
dict[x[0]] = x[1]
newListA=dict.keys()
newListB=dict.values()
import os listA = [1,2,3,4,3,2,1] listB = [7,8,9,5,4,3,1] listC = [] x = 0 while x < len(listA): listC.append(listB+ listA ) x += 1 print listC