Mar-02-2018, 05:20 PM
I'm guessing because theres no remainder.
6%3 = 0
You could try checking it first and assign 3 if it has no remainder.
There's probably a better way of doing it but this should work.
for k in range(j,j+3):Starts at index 3 and ends on 6.
6%3 = 0
You could try checking it first and assign 3 if it has no remainder.
There's probably a better way of doing it but this should work.
kdisplay= k%3 if (k%3) else 3
for i in range(1, 4): for j in range(i, i + 3): if (j > 3): jdisplay = j % 3 else: jdisplay = j for k in range(j,j+3): kdisplay= k%3 if (k%3) else 3 print(i,jdisplay,kdisplay)