how to make a cube with sphere in python by using vpython

from vpython import *
l =5
r =.3
for x in range(-l,l+1): #  x axis
    for y in range(-l,l+1): #y axis
        for z in range(-l,l+1): # z axis
            sphere(pos = vector(x,y,z),radius = r,color =color.red)

Post a Comment

0 Comments