码迷,mamicode.com
首页 > 编程语言 > 详细

作业:用python编写用户名密码输入接口程序

时间:2017-12-22 03:28:20      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:and   三次   bre   锁定   com   post   name   int   编写   

count = 0
while count <3:
username = input("username:")
password = input("password:")
‘‘‘‘‘‘输入用户密码
if username == "pang" and password == "pang123":
print("welcome")
break
‘‘‘‘‘‘
输入pang和pang123才有欢迎的打印输出并结束循环
else:
print("try again")
‘‘‘‘‘‘‘‘否则打印再试一次
count +=1
‘‘‘‘‘‘‘‘循环一次+1
else:
print("you have tried too many times,you are locked")

‘‘‘‘‘‘‘循环超过三次则打印你尝试的次数过多,已被锁定的


code:
count = 0
while count <3:
username = input("username:")
password = input("password:")
if username == "pang" and password == "pang123":
print("welcome")
break
else:
print("try again")
count += 1
else:
print("you have tried too many times,you are locked")

作业:用python编写用户名密码输入接口程序

标签:and   三次   bre   锁定   com   post   name   int   编写   

原文地址:http://www.cnblogs.com/pxj2017/p/8083099.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!