I have two list
list1 = [(100, A, 22), (200,B, 33), (300, C, 44)]
and
list2 = [(100,A,333), (200,B,444), (500, D, 555)]
so what I want as my final list is
final_list = [ (100,A, 22, 333), (200,B,33,444), (300,C,44,0), (500,D,0,555)]
If I just add the two list it wont help me out. How can i achieve the final list.
Thanks
Your input data should be dictionaries in the first place:
Now you can easily build a combined dict:
(Python 2.7)
If for some reason you need to operate on the lists, I’d suggest turning your lists into dictionaries first