Kindly help me understand why this works. The code below lists duplicates in an iterable. However, the use of the **or** operator behaves like the else in an if..else statement..

```
j = set()
my_list = [1, 2, 3 ,3 , 3 ,4, 4]
j_add = j.add
twice = set(x for x in my_list if x in j or j_add(x))
print list(twice)

```

Would expect the line to be:

```
 twice = set(x for x in my_list if x in j else j_add(x))

```

Thought or returns a boolean not a value