五:執行一個操作
提醒用戶輸入用戶名和密碼
獲取用戶名和密碼,檢測用戶名 name ,密碼 root
input 輸入 input(“>>>”) 字符型
int(input(“>>>”)) 轉換為數字
- if 條件 :
Print(“ok”)
eles :
Print(“Error”)
- if 支持嵌套
- if elif
If.... :
elif ..... :
elif ..... :
elif ..... :
else.... :
4 .pass
If 1==1:
Pass
Else:
Print(“hello”)
While 循環
Continue 結束當前循環
break 結束整個循環