I want to check if a string is in a file or not, but i can't seem to get it to work.
file = open("test.txt","r+")
username = 'user'
password = 'password'
if username+password in file:
print("true")
else:
print("false")
and the file contains:
userpassword
it should output 'true' as 'username+password' should be equal to 'userpassword', but the output is 'false',what am I doing wrong here?