Python 關鍵字
只要 x 小于 9,就打印 x:
x = 0 while x < 9: print(x) x = x + 1
運行實例
while 關鍵字用于創建 while 循環。
while 循環會繼續,直到語句為 false。
請使用 for 關鍵字 創建 for 循環。
請使用 break 關鍵字 來打破循環。
請在我們的 Python While 循環教程 中學習有關 while 循環的更多知識。