python菜鸟学习: 1.用户登录输入输出
# -*-coding: utf-8 -*-
name = 'liyuzhoupan'
password = '123'
def login_test():
count = 0
while count < 3:
_name = input("please input your name:\n")
_password = input("please input your password:\n")
if _name == name and _password == password:
print("welcome name is {_name} ,password {_password} login !".format(_name=_name, _password=password))
break
else:
print("username or password error!")
count = count + 1
print(count)
else:
print("Login times greater than 3")
login_test()
本文来自博客园,作者:鲤鱼洲畔,转载请注明原文链接:https://www.cnblogs.com/liyuzhoupan/p/16575132.html