其他分享
首页 > 其他分享> > phtyon,通过while循环简单的用户名和密码登录

phtyon,通过while循环简单的用户名和密码登录

作者:互联网

_username='zhangxin'
_password='abc123'
_username1='zhaopeng'
_password1='abc1234'
_username2="youzhiqian"
_password2="abc12345"
tount=0
while tount<3:
      username=input("username:")
      password=input("password:")
      print(username,password)
      if username==_username and password==_password:
          print("Username and password verification is correct. Welcome to login.")#用户名密码正确欢迎登录
          break
      elif username==_username1 and password==_password1:
           print("Username and password verification is correct. Welcome to login.")
           break
      elif  _username2==username and password==_password2:
           print("Username and password verification is correct. Welcome to login.")
           break

      else:
            print("Username and password are incorrect. Please re-enter")#用户名密码错误请从新输入
      tount += 1

 

标签:username,username1,password2,用户名,password1,tount,phtyon,while
来源: https://www.cnblogs.com/zhangxin80s/p/11073515.html