I am trying to find the intersection of the two lists without making them into sets in python. I need to know what is wrong in this code. Can't variables like i and y be equated? This is the code that i have written below:
l1 = [10, 20, 30, 70, 80, 69, 100, 20, 40]
l2 = [30, 50, 60, 70, 69, 40]
for i in l1:
for y in l2:
if y == i:
l1.remove(i)
print(l1)