BrU32

PY Turtle Spin In Place SRC

Dec 16th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import turtle
  2.  
  3. def drawSquare(t, sz):
  4. """Make turtle t draw a square of with side sz."""
  5.  
  6. for i in range(4):
  7. t.forward(sz)
  8. t.left(90)
  9.  
  10.  
  11. def main(): # Define the main function
  12. wn = turtle.Screen() # Set up the window and its attributes
  13. wn.bgcolor("lightgreen")
  14.  
  15. alex = turtle.Turtle() # create alex
  16. drawSquare(alex, 1) # Call the function to draw the square
  17.  
  18. wn.exitonclick()
  19.  
  20. main() # Invoke the main function
Advertisement
Add Comment
Please, Sign In to add comment