返回顶部
扶摇直上九万里,展翅高飞岂可待。

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()
posted @ 2022-08-11 10:35  鲤鱼洲畔  阅读(21)  评论(0编辑  收藏  举报