Question: I have a list of tuples with (string,int) pairs. 

I also have a list of int's.

I want to filter the list of tuples by the following psuedocode:

```
l1 = list of touples(string,int)
l2 = list of int's

for tuple in l1:
   if tuple(int) is in l2
      remove tuple from l1

```

For example, lets say

```
l1=[("one",1),("two",5),("three",8),("bla",11)]

l2=[1,8]

```

Output would be:

```
[("two",5),("bla",11)]

```

Hopefully thats clear.

Answer: 
You should create a set of the filter values, and then use list comprehension for constructing a new list:

```
l1 = [("one",1),("two",5),("three",8),("bla",11)]
l2 = [1,8]
# Make a set for efficient 
s2 = set(l2)
# List comprehension for including only tuples where integer is not in s2 (l2)
l3 = [t for t in l1 if t[1] not in s2]

print(l3)

```
I'd use either filter or list comprehensions, like this:

```
filtered_tuples = [t for t in l1 if t[1] not in l2]

```

If you feel more comfortable using for loops, you could just do:

```
filtered_tuples = []
for t in l1:
    if t[1] not in l2:
        filtered_tuples.append(t)

```

Whenever you have an iterable, you can use the in keyword to check if an object is somewhere inside that iterable.