Reputation: 181
first_list=[[2,3],[],[1,3],[]]
second_list=[[1,2,3],[1,2,3],[1,2,3],[1,2,3]]
I want to append the numbers of the first list to the second list at the same indexes. This should return:
[[1,2,3,2,3],[1,2,3],[1,2,3,1,3],[1,2,3]]
This seems complicated and I'm just a beginner at python.. please give me some help on how to approach this!
Upvotes: 0
Views: 130
Reputation: 1932
I am just adding the answer here:
[x+y for x,y in zip(second_list,first_list)]
Upvotes: 1