'''lecture_15_objects_in_lists.py Show slices of lists of objects not independent Oliver W. Layton CS 151: Computational Thinking: Visual Media Fall 2020 ''' import turtle def setColor(turtles, colorList): pass def forward(turtles, amount=100): '''Move all turtles `amount` units in x direction''' for turt in turtles: turt.forward(amount) # Create the screen screen = turtle.Screen() # Create 3 Turtles, move them to different positions along y axis # Add them to a list # Set the color of each rectangle to a unique color setColor(turtles, ['green', 'red', 'blue']) # Wait until we hit enter input('Pausing until you press Enter...') # Slice the Turtle object list, taking the 1st two # Draw all 3 rectangles in the original list (ignoring two list) forward(turtSlice) # Close the window after the click screen.exitonclick()