while (true):執行
#當 (條件成立時): 執行
if( true) : 執行
#如果 (條件成立時): 執行
if (條件) : break #跳出while 迴圈
if (條件) : continue #暫停一次,繼續
if (條件) : break #跳出while 迴圈
total = 10 #30
while (total <= 100) : #當 (條件成立時)
print(total) #50
if(total == 50): #如果 (條件成立時) 50==50
break #執行跳出while迴圈
total += 10
print(123) #已跳出While迴圈

if (條件) : continue #暫停這次以下while程式碼 ,再繼續
total = 0
while (total < 100) :
total += 10
if (total == 50):
continue
#暫停這次以下while程式碼 ,再繼續
print(total)

Yiru@Studio - 關於我 - 意如