Question: I've two python class 'tuples' and and i want to compare contents on both of them and get only which is only in 'deactivated' tuple for eg.,

```
deactivated = ((34, 'abcd'), (250, 'def'), (350, 'xyz'))
schedules = ((34, 'abcd'), (250, 'def'))
to_deactivate = ()

```

in here, i want to push `(350, 'xyz')` which is not in schedules to another variable `to_deactivate`.

I've looked into some of the solutions online but most of them are just comparing whether the tuples are same or not. Please help me out on this.

Answer: 
Try:

```py
deactivated = ((34, "abcd"), (250, "def"), (350, "xyz"))
schedules = ((34, "abcd"), (250, "def"))

to_deactivate = tuple(tpl for tpl in deactivated if tpl not in schedules)
print(to_deactivate)

```

Prints:

```
((350, 'xyz'),)

```
You could use iteration to compare every element in one tuple to every element of the other tuple and get the the value of index for which there exist value only in the first tuple

```
deactivated = ((34, 'abcd'), (250, 'def'), (350, 'xyz'))
schedules = ((34, 'abcd'), (250, 'def'))
to_deactivate = ()
for i in range(len(deactivated)):
    if deactivated[i] not in schedules:
        to_deactivate += deactivated[i]
print(to_deactivate)

```

This should work fine.

Edit: Iterating only once.