0
使用Python作爲例子:向後模/提醒週期
for i in range(-5, 5, 1):
print(i % 4, end = " ") ## Will output 0 1 2 3 0 1 2 3...
有沒有一個很好的辦法做得到隨輸入包括負數逆循環?如何在不使用條件的情況下獲得以下內容?
for i in range(5, -5 , -1):
print('''Something here''', end = " ") ## Will output 3 2 1 0 3 2 1 0...
我才意識到,我有一個不同的問題 –