用户登录while语句

 1 #!/use/bin/env python
 2 # -*- coding:utf8 -*-
 3 count = 0
 4 while count < 3 :
 5     user = input('>>>>')
 6     pwd  = input('>>>>')
 7     if user == "kele" and pwd == "live":
 8         print("欢迎登陆")
 9         print(".......")
10         break
11     else:
12         print("用户名或密码错误")
13 
14     count = count + 1
View Code

 

posted @ 2020-04-22 16:08  可乐·Bentley  阅读(14)  评论(0)    收藏  举报