Question: given these two lists

```
l1=[0,0,0,0,1,1,1,1]
l2=[0,0,0,1,1,1,1,1]

```

they are identical except for the 4th element. I need a code that detects the difference between these two sets and prints out the location of the detected difference. In this case it would be = 4.
The `intersection` and `union` command wouldn't work as they don't take the index into consideration.

I have tried this code, but it does not print out anything:

```
l1=[0,0,0,0,1,1,1,1]
l2=[0,0,0,1,1,1,1,1]

for i in l1:
    if i != l2[l1.index(i)]:
        print(l1.index(i),i)

```

Answer: 
You can use zip

```
l1=[0,0,0,0,1,1,1,1]
l2=[0,0,0,1,1,1,1,1]

diff_idx = [idx for idx,(x,y) in enumerate(zip(l1,l2)) if x != y]
print(diff_idx)

```

output

```
[3]

```
```
l1=[0,0,0,0,1,1,1,1]
l2=[0,0,0,1,1,1,1,1]
print(l1.index(l1 != l2))

```

The third line returns the index position of l1 which does not satisfy the condition l1 not equal to l2.