while condition: #do something
while迴圈相對單純它會於condition = True的情況下不斷執行以下舉幾個範例
i = 0 while i < 6: print(i) i+=1 #0,1,2,3,4,5
而以上這個例子又同等於 for i in range(6)
for i in range(6)