用Python编写账号密码登录程序

for i in range(3):
    name = int(input("请输入用户名:"))
    password = int(input("请输入密码:"))
    if name == "hangzhou" and password == "jbkj":
                   print("登录成功")
                   break
    else:
                   print("登录失败")
                   print("你还有%d次机会登录"%(2-i))
else:
                   print("登录失败,请于120S后再次登录")

你可能感兴趣的:(用Python编写账号密码登录程序)