I open a text file and add to the variable all its values that look like this
aaa: bbbbbb
cccc: www
ww: gg
How do I implement a check whether this document contains the exact value (aaa: bbbbbb)? I tried through .find () and through if .. in ..., but when I entered, for example, a: b returns! = -1, and should work only if the entire line contains exactly the value that was entered. Tell me how to do this?
def login(login, password): logins = open('logins.txt', 'r') logins = logins.read() logpass = login + ":" + password if logins.find(logpass) != -1: return 1 else: return 0