Commit c08f1189 by BellCodeEditor

save project

parent 4a7cb6b6
Showing with 19 additions and 0 deletions
#保存在数据库中的用户正确的用户名和密码
usename = "python"
password = "123456"
#用户名和密码的输入与判断
while True:
#1、用input提示用户输入用户名和密码,分别保存在us变量和ps变量中
us = input("请输入您的用户名:")
ps = input("请输入您的密码:")
#2、如果用户名和密码正确,输出登陆成功
if (us == usename) and (ps == password) :
print("用户名、密码正确,登陆成功!")
#3、如果用户名、密码输入不正确,提示重新输入
if us != usename :
print("用户名不正确,请重新输入!")
if ps != password :
print("密码不正确,请重新输入!")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment