I am trying to loop through two lists and only want to print an item if it DOES exist in the second list. I will be doing this through very large files so do not want to store them in memory like a list or dictionary. Is there a way I can do this without storing into a list or dict?

I am able to do the below to confirm they are NOT in the list but unsure why it is not working when I am trying confirm they ARE in the list by removing the "not".

Code to verify item DOES NOT exist in list\_2.

```
list_1 = ['apple',
          'pear',
          'orange',
          'kiwi',
          'strawberry',
          'banana']

list_2 = ['kiwi',
          'melon',
          'grape',
          'pear']

for fruit_1 in list_1:
    if all(fruit_1 not in fruit_2 for fruit_2 in list_2):
        print(fruit_1)

```

Code to verify item DOES exist in list\_2.

```
list_1 = ['apple',
          'pear',
          'orange',
          'kiwi',
          'strawberry',
          'banana']

list_2 = ['kiwi',
          'melon',
          'grape',
          'pear']

for fruit_1 in list_1:
    if all(fruit_1 in fruit_2 for fruit_2 in list_2):
        print(fruit_1)

```