'''lecture_16_objects_in_lists_zelle.py Show slices of lists of objects not independent Oliver W. Layton CS 151: Computational Thinking: Visual Media Spring 2021 ''' import graphics as gr def setColor(shapeList, colorList): '''Sets the color of corresponding shapes in `shapeList`. `shapeList` is the list of shapes `colorList` is the list of shapes Both have the same length ''' pass def draw(shapeList, window): '''Draw each shape in `shapeList` on the canvas `window`''' pass # Create the screen # Create 3 Rectangles, add them to a list `shapes1` # Coordinates of their corners: # (25, 25) (75, 75) # (125, 25) (175, 75) # (225, 25) (275, 75) # Set the color of each rectangle to a unique color # Draw the shapes1 on the canvas/window # Keep the window open until we click # Slice the object rectangle object list, taking the 1st two # Draw the shapes in `shapes2` # draw(shapes2, screen) # Set the colors of the 2 Rectangles in `shapes2` to unique colors # Keep the window open until we click # Close the window after the click