I am creating a very basic program that checks if a variable is in a txt file or not, But when I open the txt file and write IF Else statement to python does not read the file.
f = open("Rdatabase.txt", "r")
if Lemail in f.read():
print("Email OK")
else:
print("Email not registered")
if Lpass in f.read():
print("Pass OK")
else:
print("Pass Wrong")
The output of this program is "Email OK" but "Pass Wrong".And when I open the same file with different variable say "A" the output changes to Pass OK. Why is that?