# drawing.py # ---------- # By _Heather Maher_________ # # (This program creates an abstract pattern using complementary colors) import turtle from turtle import * # Setup the screen screen = turtle.Screen() screen.bgcolor("black") # Create the turtle t = turtle.Turtle() t.speed(10) t.width(3) # Complementary colors for the pattern colors = [("red", "green"), ("blue", "orange"), ("yellow", "purple")] def square(size, color1, color2, side_length): for _ in range(4): t.color1 forward(side_length) right(90) forward(side_length) right(90) forward(side_length) right(90) forward(side_length) right(90) # Function to draw the abstract pattern def draw_pattern(): size = 100 for i in range(20): color1, color2 = colors[i % len(colors)] draw_square(size, color1, color2) t.left(36) size += 10 input()