# 一、【用户登陆程序】
# 基础需求:
# 让用户输入用户名密码
# 认证成功后显示欢迎信息
# 输错三次后退出程序
count = 0 name = "cheng" password = "123456" while count <3: count += 1 your_name = input ("请输入你的名字:") your_pwd = input ("请输入你的密码:") if your_name == name and your_pwd == password: print("登录成功,欢迎进入..") break else: print("名字或密码错误,你还有%s次机会" % (3-count))