lingojot
[#python]
i = 0
while 1==1:
print(i)
i = i + 1
if i >= 5:
print("Breaking")
break

print("Finished")
lingojot
while Loops, break statement
lingojot
Result:
>>>
0
1
2
3
4
Breaking
Finished
>>>
載入新的回覆