Hello! I'm trying to make a rainbow cube and realized this
why does this output 0...
full code:
why does this output 0...
print(6%6)but this outputs 6?
print(6+0%6)I'm also using trinket.io/glowscript
full code:
import vpython as vp from random import choice scene = vp.canvas() colors = [ vp.color.red, vp.color.orange, vp.color.yellow, vp.color.green, vp.color.blue, vp.color.purple, ] for x in range(6): for y in range(6): for z in range(6): print(6==6+0, 6%6==6+0%6) vp.box(pos=vp.vector(x-10, y-10, z-10), color=colors[x+y+z%6 if x+y+z%6<=5 else 5] )