Hi, I would like to compare elements in two seperate Lists for example:
What I understand is that the syntax should look like this:
What i specifically would like to do is that in List1. If List1[i][1] is found in List2[j][0] then i would like to pull out the List1 elements for which this is True.
Please help I am very confused!
Thanks
Code:
List1=[['Primi ', ' Movida ', ' 5'], ['Primi ', ' CCHQ ', ' 40'], ['Primi ', ' Chicago ', ' 45']]
Code:
List2=[['Chicago ', ' The Doors ', ' 20'], ['CCHQ ', ' The Doors ', ' 10']]
Code:
List3
for i in List2:
for j in List1:
if i[0]==j[1]
List3.append(j)
What i specifically would like to do is that in List1. If List1[i][1] is found in List2[j][0] then i would like to pull out the List1 elements for which this is True.
Please help I am very confused!
Thanks
Comment