I am curious how to create an example of a program in which a user logs in (I know how to do this part), but when a user logs in and the username is added to the list or dictionary that they have a lot of, it cannot be another user password, because if I do "if x to x:" because it will allow another user to use a password to access another user. I just want the correct data to match.
users = ["bob", "joe"]
passwords = ["example1", "example2"]
ex1 = input("What is your username?")
if ex1 in users:
ex2 = input("enter your password")
if ex2 in passwords:
print("access granted")
source
share