I have been searching for this answer but did not quite get it.
I have a text file that looks like this
who are you????
who are you man?
who are you!!!!
who are you? man or woman?
I want to skip the line with man
in it and print
who are you????
who are you!!!!
My code so far
f = open("test.txt", "r")
word = "man"
for line in f:
if word in line:
f.next()
else:
print line
This prints the first line only
who are you????
How should I troubleshoot this problem?
Thank you for your help.