Advertisement
makispaiktis

Drawing 'TOM' with turtle

Apr 19th, 2021 (edited)
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. from turtle import *
  2. shape("turtle")
  3. speed(2)
  4. pensize(6)
  5.  
  6. # Drawing 'T' letter
  7. color('white')
  8. back(300)
  9. color('red')
  10. left(90)
  11. forward(200)
  12. left(90)
  13. forward(125)
  14. left(180)
  15. forward(250)
  16.  
  17. # Taking position to draw 'O'
  18. color("white")
  19. forward(100)
  20.  
  21. # Drawing 'O' letter
  22. color("red")
  23. N = 20
  24. angle = 360 / N
  25. for i in range(N):
  26.     forward(34)
  27.     right(angle)
  28.  
  29. # Taking position to draw 'M'
  30. color("white")
  31. left(90)
  32. forward(30)
  33. right(90)
  34. forward(200)
  35. right(90)
  36. forward(230)
  37. right(180)
  38.  
  39. # Drawing 'M' letter
  40. color("red")
  41. forward(200)
  42. right(140)
  43. forward(100)
  44. left(100)
  45. forward(100)
  46. right(140)
  47. forward(200)
  48.  
  49. # Gaining time
  50. color("white")
  51. forward(100)
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement