`for example
user_database = [ [“Ojku”, “password123”], [“Cbugo”, “Pass”], [“Amara”, “securepassword”] ]
def authenticate_user(username, password): for user in user_database: if user[0] == username: if user[1] == password: return “Access granted. Welcome!” else: return “Password incorrect. Access denied.” return “Username not found. Access denied.” `
submitted by /u/Antique_Shallot_3403
[link] [comments]
r/learnpython `for example user_database = [ [“Ojku”, “password123”], [“Cbugo”, “Pass”], [“Amara”, “securepassword”] ] def authenticate_user(username, password): for user in user_database: if user[0] == username: if user[1] == password: return “Access granted. Welcome!” else: return “Password incorrect. Access denied.” return “Username not found. Access denied.” ` submitted by /u/Antique_Shallot_3403 [link] [comments]
`for example
user_database = [ [“Ojku”, “password123”], [“Cbugo”, “Pass”], [“Amara”, “securepassword”] ]
def authenticate_user(username, password): for user in user_database: if user[0] == username: if user[1] == password: return “Access granted. Welcome!” else: return “Password incorrect. Access denied.” return “Username not found. Access denied.” `
submitted by /u/Antique_Shallot_3403
[link] [comments]