第一天学习python,在这里来做一道练习题!

                                                         编写登录接口

                     要求:输入用户民和密码

                               认证成功后显示欢迎信息

                               输错三次后锁定

正文开始:

#Author:Peter joy
import getpass
count=0
_username ='abc'
_password ='asd123'
username=input("username:")
password=getpass,getpass("password:")
while count<3:

if("_username==username and _password==password"):
print("Welcome")
else:
print("Sorry,it's wrong")
count=count+1
else:
print("ok,byebye forever")


posted on 2017-06-24 17:08  洋洋三千字  阅读(105)  评论(0)    收藏  举报