#------------------------------------------------------------------------------- # TurtleFunction1.py #------------------------------------------------------------------------------- import turtle def draw_square(t, s): """Make turtle t draw a square of side length s.""" for i in range(4): t.forward(s) t.left(90) # end of function draw_square() # end draw_square() #-- main program -------------------------------------------------------------- wn = turtle.Screen() # Set up the window and its attributes wn.bgcolor("lightgreen") wn.title("Alex and Tess meet functions") alex = turtle.Turtle() # Create alex tess = turtle.Turtle() # Create tess tess.pencolor("red") tess.pensize(10) draw_square(alex, 50) # Call the function to draw the square tess.right(45) draw_square(tess, 150) draw_square(alex, 175) wn.mainloop()