是否有辦法用同一個迭代器重復一個回圈,而不以i遞增1?
for i in range(100):
random_function()
if status_code != 200:
#repeat function with same iterator without incrementing by 1.
uj5u.com熱心網友回復:
使用一個while回圈,自己控制增量
i = 0。
while i < 100:
foo()
if status == 200:
i = 1: i = 1.
或者在你的 "隨機函式 "中建立重試邏輯
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/327334.html
標籤:
