用户登陆(三次机会) count = 0 while count < 3: user = input(‘请输入账号:‘) pwd = input(‘请输入密码:‘) if user == ‘admin‘ and pwd == ‘123456‘: print("登陆成功") break else: print("账号或密码错误,请重新输入") count = count + 1
原文地址:https://www.cnblogs.com/liujinjing521/p/11006985.html
时间: 2024-10-07 14:03:41