-8
A
回答
-2
因爲當pat = 24
,程序這將在else第一個條件應該大於或等於和然後試圖訪問該指數24的範圍內,但最後指數爲23。
roue = range(24)
pat = int(input())
if pat >= 24:
while pat >= 24:
pat -= 24
else:
while pat < 0:
pat += 24
print(roue[pat])
+0
請停止回答不包含任何內容的問題。這樣做可以消除海報編輯它們的任何動機,這意味着它們對未來的讀者沒有價值。想要幫助是件好事,但這裏的最終目標是幫助未來的人們以及這張海報。 –
+0
這個answear非常重要謝謝你的幫助Andres here another answear: nbZones = int(input()) print(nbZones%24) –
相關問題
- 1. IndexError:列表索引超出範圍 - 蟒蛇
- 2. IndexError:列表索引超出範圍蟒蛇
- 3. 蟒蛇:IndexError:列表分配索引超出範圍
- 4. IndexError:彈出索引超出範圍(蟒)
- 5. IndexError:字符串索引超出範圍,pyserial的Tkinter,蟒蛇3.4
- 6. 我不斷收到indexerror:索引列表超出範圍的蟒蛇
- 7. IndexError:列表索引超出範圍
- 8. Ctypes,IndexError:列表索引超出範圍
- 9. IndexError:列表索引超出範圍
- 10. IndexError:列表索引超出範圍
- 11. IndexError:列表索引超出範圍'
- 12. python IndexError:列表索引超出範圍
- 13. IndexError:列表索引超出範圍123
- 14. odoo IndexError:列表索引超出範圍
- 15. Python - IndexError:列表索引超出範圍
- 16. IndexError:列表索引超出範圍?
- 17. IndexError:列表索引超出範圍
- 18. IndexError:列表索引超出範圍
- 19. IndexError:列表索引超出範圍| webapp2
- 20. IndexError:列表索引超出範圍(Python)
- 21. python IndexError:列表索引超出範圍
- 22. IndexError:列表索引超出範圍?
- 23. IndexError - 「列表索引超出範圍」
- 24. IndexError:'列表索引超出範圍'
- 25. IndexError:列表索引超出範圍// numpy?
- 26. Python ::「IndexError:列表索引超出範圍」
- 27. IndexError:列表索引超出範圍蟒 - 3.4.3
- 28. IndexError:列表索引超出範圍。它應該在範圍
- 29. 奇怪蟒蛇索引超出範圍
- 30. IndexError:索引超出範圍
告訴你的代碼,如文本,請 –
請發表您的代碼在你的問題,不只是鏈接的屏幕截圖。 – Zinki
https://stackoverflow.com/help/how-to-ask –