from visual import * input = raw_input x = 3 y = 4 z = 5 # Make these into a position pos = [x,y,z] # To go the other way x, y, z = pos # To add to pos pos[1] += 5 print(pos) def translate_color(col): if col == "red": return 1, 0, 0 if col == "green": return 0, 1, 0 def get_color(): return [float(x) for x in input("Enter a color as RGB (separate with spaces): ").split()] sphere(pos=(pos[0], pos[1] - 5, pos[2]), color=get_color()) # Helper function! Add positions. def add_positions(a, b): ax, ay, az = a bx, by, bz = b return (ax + bx, ay + by, az + bz) sphere(pos=add_positions(pos, (0, 3, 0)))