SHARE
TWEET

CSH2012 squares.py

calcpage Mar 20th, 2013 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python
  2. #squareColor.py MrG     2013.0318
  3. import turtle
  4. alex=turtle.Turtle()
  5. alex.pensize(10)
  6. alex.color("red")
  7.  
  8. def drawSquare(t, size):
  9.     for i in ['red','gray','blue','green']:
  10.         t.color(i)
  11.         t.forward(size)
  12.         t.left(90)
  13.  
  14. size=40
  15. for i in range(15):
  16.     drawSquare(alex, size)
  17.     alex.right(18)
  18.     size=size+10
  19.  
  20. turtle.mainloop()
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Top