-5
while count > 0:
if count = 0:
return n
elif count < 0:
print(" ") # prints empty if n is below 0
else:
count = count - 1
collect += math.ceil((n - 5)/2)
return collect
輸入是(1003,3) - 結果是499,這意味着它只是循環一次,然後減去5,然後除以2,然後停止。有人知道爲什麼爲什麼只循環一次?
'='是不是''==。 – Chris
仍然不起作用 – Gekz
您也未顯示完整的代碼。輸入_to what_?來自什麼?你真的想在你的循環中「返回」嗎? – Chris