1. 程式人生 > >編寫登錄窗口

編寫登錄窗口

post OS wrong 三次 ont sse HR you enter

要求:

1、輸入用戶名和密碼

2、認證成功後顯示歡迎信息

3、輸錯三次鎖定

Python實現代碼如下:

# -*- coding: UTF-8 -*-
C = 0
name = "quan"
passed = 123
while C < 3:
username = input("username:")
password = int (input("password:"))
if username == name and password == passed:
print("welcome!")
break
C = C + 1
if C == 3:

print("you Enter the wrong lock three times!")

編寫登錄窗口