phtyon,通过while循环简单的用户名和密码登录
Posted zhangxin80s
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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
以上是关于phtyon,通过while循环简单的用户名和密码登录的主要内容,如果未能解决你的问题,请参考以下文章
小白的Python之路 day1 表达式if ... else ,while循环,for循环