如何存储用户名和密码,并能够在python中添加它们?

时间:2017-03-16 16:34:26

标签: python passwords username

我试图通过将用户名存储在列表中并将密码存储在列表中来创建用户名和密码脚本。

我通过互联网上的研究完成了所有工作。 这是我的代码。

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)

0 个答案:

没有答案