Advertisement
makispaiktis

Turtle - N-gons

Apr 15th, 2021 (edited)
977
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. from turtle import *
  2. color("red")
  3. shape("turtle")
  4. speed(2)
  5. pensize(8)
  6.  
  7. N = 8
  8. angle = 360 / N
  9. for i in range(N):
  10.     forward(50)
  11.     right(angle)
  12.  
  13. color("white")
  14. left(2* angle)
  15. forward(100)
  16.  
  17. color("blue")
  18. N2 = 10
  19. angle2 = 360 / N2
  20. for i in range(N2):
  21.     forward(50)
  22.     right(angle2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement