I'm trying to make a basic program that lets the user input a username and password and if it watches one in a file it outputs 'access granted' but the password won't match when compare with the file data even if they are the same
I've tried setting the data saves password as a variable however that hasn't worked
username = str(input('What is your username'))
password = str(input('What is your password'))
accountlogin = 0
file = open('login.txt','r')
for line in file:
seperate = line.split(',')
print(seperate[0])
if username == seperate[0]:
accountlogin = accountlogin + 1
for line in file:
if password == seperate[1]:
accountlogin = accountl`enter code here`ogin + 1
print(accountlogin)
if accountlogin == 2:
print('Access Granted')
correct username so make it equal 3 it does so the password bit must not be working