I'm trying to extend two lists of lists in python, so that item 1 of the first list of lists extends with item 1 of the second list of lists, and so forth. I'm new to this and self-taught, so could be missing something very simple, but I can't find an answer anywhere. This is what I feel the code should be, but obviously not working.
list1[x].extend(list2[x]) for x in list1
What I'm trying to achieve is this:
list1 = [[1,2,3],[4,5,6],[7,8,9]]
list2 = [[a,b,c],[d,e,f],[g,h,i]]
output = [[1,2,3,a,b,c],[4,5,6,d,e,f],[7,8,9,g,h,i]]
Any ideas?