Jan-09-2020, 01:27 AM
Hi, Folks! I'm trying to open a .txt file and find a line with a specific expression but the return isn't what I expected:
f = open("file.txt", "r") for line in f: if "Net" in line: print(line) else: print("Didn't find") f.close()So, what i get is a lot of "Didn't find" but I know that there's this expression in the file. And, I noticed that if i ask for just one caracter, like "N" instead the "Net", the code returns lines with it.