Advertisement
jabela

squarepattern

Oct 15th, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import turtle
  2. size = 20                   # size of the smallest square
  3.  
  4. def draw_multicolour_square(sz):
  5.     """Make turtle t draw a multi-colour square of sz."""
  6.     for i in ['red','purple','hotpink','blue']:
  7.         turtle.color(i)
  8.         turtle.forward(sz)
  9.         turtle.left(90)
  10.  
  11. for i in range(15):
  12.     draw_multicolour_square(size)
  13.     size = size + 10          # increase the size for next time
  14.     turtle.forward(10)        # move turtle along a little
  15.     turtle.right(18)          # and turn a little
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement