Given two very large lists (about 50K records) list1 = [['a','b','c'],['d','e','f']] and list2 = [['a','r','t'],['d','e','n']] . How to obtain list3 = [['a','b','c','r','t'],['d','e','f','e','n']]
Here I'm joining by comapring the first character of the second list's sublists and taking only one of them in final list
I am new to python I tried
i=0
final=[]
while (i<len(list1)) :
for row in list2 :
if(list1[i][0]==list2[0]) :
final= row + list[i][1:]
i+=1
But this does not work