0

In python I am trying to run this code:

    blacklist = ['hello', 'man']
    for word in open("text.txt"):
      if word not in blacklist:
          print(word)

In text.txt I have

test hello man

I would like the output to be:

test

But - it just returns the text of text.txt! What is the issue?

Blaze612 YT
  • 594
  • 7
  • 13

0 Answers0