我试图通过将用户名存储在列表中并将密码存储在列表中来创建用户名和密码脚本。
我通过互联网上的研究完成了所有工作。 这是我的代码。
user_list = ["Mineman","NeonDerp","Memes"]
global user_list
Mineman_password = "RG"
Neonderp_password = "05"
Memes_password = "DOge"
passwords_list = [str(Mineman_password),str(Neonderp_password),str (Memes_password)]
global password_list
logsin = input("Login or sign up")
logsin = logsin.lower()
if logsin == "login" :
def user_name():
username = input("Username")
if username in users_list :
pass
else:
print("No matching users")
def pass_word():
password = user_password
Intpw = input("Password")
if intpw == password :
print("Logged in")
else:
print("WRONG")
else:
adduser = input("What would you like as your user namename to be")
if adduser in users_set :
print("Username already taken")
else:
users.add(adduser)
addpw = input("What would you like your password to be")
passwords.add(addpw)