I'm still pretty new at programming. I have a two Lists:
List1=[[1,2,3,4],[5,6,7,8],[9,10,11,12]]
List2=['a','b','c']
and I want to put the values of one list into the other one, so my output looks like this:
List1=[[1,2,3,4,'a'],[5,6,7,8,'b'],[9,10,11,12,'c']]
So far I managed to write this:
for i in range(0,len(List1)):
for row in List1:
row.insert(5, List2[i])
But i get this:
List1=[[1,2,3,4,'a','b','c'],[5,6,7,8,'a','b','c'],[9,10,11,12,'a','b','c']]
I'm sure it's probably a simple mistake, but I can't find out what it is.
for row in list:, what islist? also, you're missing a closing).