I’m trying to make a login system, but an if statement that needs to be entered to log in won’t work, I have the login details in a separate file in a 2d array, and if I remove the 2d array and just keep the username, it will work but it doesn’t if I have the 2d array, here is part of my code:
f = open(‘authenticated.txt’)
authenticated = f.readline()
print(authenticated)
name = input('Enter your name to check if you’re verified: ')
while not logged_in:
for i in range(len(authenticated)):
if name == authenticated[i-1][0]:
password = input('Authenticated user, enter password to log in: ')
Here is the text file:
[[BenWherry, password], [ThomasWherry, 1qaz2wsx],[JessicaWherry, qwertyuiop]]