python学习-8 用户有三次机会登陆
程序员文章站
2022-08-02 23:46:06
用户登陆(三次机会)count = 0 while count < 3: user = input('请输入账号:') pwd = input('请输入密码:') if user == 'admin' and pwd == '123456': print("登陆成功") break else: pr... ......
用户登陆(三次机会)
count = 0 while count < 3: user = input('请输入账号:') pwd = input('请输入密码:') if user == 'admin' and pwd == '123456': print("登陆成功") break else: print("账号或密码错误,请重新输入") count = count + 1