1. 程式人生 > >python Day03-2

python Day03-2

format input python welcom and mat jea -s for

編寫登陸接口

輸入用戶名密碼
認證成功後顯示歡迎信息
輸錯三次後鎖定


user = "jean"
pwd = "123456"
count = 0
while count < 3:
count += 1
username = input("username: ")
passworld = input("passworld: ")

if count == 3:
print("Account is locked..")
exit(1)

if username == user and passworld == pwd:
print("Welcome {name} login.".format(name=username))
exit(1)
else:
print("invliad user or password. try again")

python Day03-2