for line in infile:
if(line[len(line)-1:] = "\n"):
line = line[:len(line)-1]
output = "Searching for: " + line
search.append([line,output])
Giving me the error:
if(line[len(line)-1:] = "\n"):
^
SyntaxError: invalid syntax
I'm basically trying to take each line of the file and I want to exclude the newline character at the ends of the lines... at first i just had "line = line[:len(line)-1]" but it was removing the last character from the last line which does not have a newline character at the end
======================
NEVERMIND: I see stupid error... i wasn't comparing, i was assigning with =