49行50行删了就行user_data={}
def new_user():
name=input('请输入用户名:')
while True:
if name in user_data:
print("已经存在该用户!")
continue
else:
break
passwd = input('请输入密码:')
user_data[name] = passwd
print("注册成功")
def user_up():
prompt = '请输入用户名:'
while True:
name = input(prompt)
if name not in user_data:
prompt = '您输入的用户名不存在,请重新输入:'
continue
else:
break
passwd = input('请输入密码:')
pwd = user_data.get(name)
if passwd == pwd:
print('欢迎进入XXOO系统,请点右上角的X结束程序!')
else:
print('密码错误!')
def sjuk():
promopt = '''
|--- 新建用户:N/n ---|
|--- 登录账号:E/e ---|
|--- 推出程序:Q/q ---|
请输入指令代码:'''
while True:
chosen = False
while not chosen:
chosen = input(promopt)
if chosen not in 'NnEeQq':
print("代码指令错误")
if chosen == 'q' or chosen == 'Q':
break
if chosen == 'N' or chosen == 'n':
new_user()
if chosen == 'E' or chosen == 'e':
user_up()
sjuk()
|