python简单实现用户表单登录
实现简单的用户表单验证登录
user="desperado" pwd="123456" s=0 for i in range(10): if s < 3: username = input("用户名:") password = input("密码:") if username == user and password == pwd: print("welcome,login successful") break else: print("username or password input error") else: con=input("rester input:") if con == 'y': s=0 continue else: print("input error,exit...") break s += 1
说明:循环10次,输入错误3次进行提示是否继续