MrThoe

Untitled

Aug 27th, 2019
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. """
  2. This is an example of the package: turtle
  3. """
  4.  
  5. import turtle
  6.  
  7. allen = turtle.Turtle()
  8. window = turtle.Screen()
  9. window.title("Allen")
  10. window.colormode(255)
  11. window.bgcolor(14, 176, 30)
  12.  
  13. allen.speed(7)
  14. allen.color()
  15.  
  16. turtle.delay(0)
  17. #Polygon with 2 parameters (num sides, side lengh)
  18. def poly(numSides, sideLength):
  19. for i in range(numSides):
  20. allen.forward(sideLength)
  21. allen.right(360/numSides)
  22.  
  23. #Standard FOR loop
  24. for i in range(1000):
  25. poly(10, i)
  26. allen.right(4)
Advertisement
Add Comment
Please, Sign In to add comment