1. 程式人生 > >Python-01-基礎

Python-01-基礎

Python

  - 基礎

    第一句python

    兩種執行方式 

    直譯器路徑

    編碼

    執行一個操作

    變數名

    條件語句

    迴圈

    

#使用者登陸(三次機會重試)
count = 1
flag = False
while count < 4 and flag == False:
    name = input("請輸入使用者名稱:")
    password = input("請輸入密碼:")
    if name == "root" and password == "root":
        
print('登陸成功') flag = True else: print('登陸失敗,清重新輸入使用者名稱及密碼') count = count + 1