首页 > 其他 > 详细

编写登陆接口

时间:2017-08-24 09:14:57      阅读:245      评论:0      收藏:0      [点我收藏+]

 

编写登陆接口:

    输入用户名密码
    认证成功后显示欢迎信息
    输错三次后锁定

 技术分享

 

 1 #!/usr/bin/env python
 2 # -*- coding:utf-8 -*-
 3 
 4 
 5 name = "mike"
 6 pswd = "1"
 7 import getpass
 8 count = 0
 9 while count < 3:
10     user_input = input("请输入姓名:")
11     pswd_input = getpass.getpass("请输入密码:")
12     if user_input == name and pswd_input == pswd:
13         print("欢迎!")
14         break
15     elif user_input != name:
16         print("用户名错误!")
17     else:
18         print("密码错误!")
19     count += 1
20 else:
21     print("超过次数限制!")

 

编写登陆接口

原文:http://www.cnblogs.com/mikehao/p/7421033.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!