Advertisement
sakibalhasannaim

Iron Man Logo Make With Python Turtle Code

Aug 25th, 2023
339
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.29 KB | Source Code | 0 0
  1. import turtle
  2. from turtle import *
  3.  
  4. t=turtle.Turtle()
  5. wn=Screen()
  6.  
  7. wn.bgcolor("#800000")
  8. t.pensize(1)
  9. t.hideturtle()
  10.  
  11. #circles
  12. t.penup()
  13. t.setposition(0,-270)
  14. t.pendown()
  15. t.begin_fill()
  16. t.color("#ffc300")
  17. t.pencolor("#ffc300")
  18. t.circle(270)
  19. t.end_fill()
  20. t.penup()
  21.  
  22. t.setposition(0,-240)
  23. t.pendown()
  24. t.begin_fill()
  25. t.color("black")
  26. t.pencolor("black")
  27. t.circle(240)
  28. t.end_fill()
  29. t.penup()
  30.  
  31. t.setposition(240,0)
  32. t.pendown()
  33. t.begin_fill()
  34. t.color("#4d0000")
  35. t.pencolor("#4d0000")
  36. t.fd(30)
  37. t.right(-90)
  38. t.circle(270,90)
  39. t.right(270)
  40. t.fd(30)
  41. t.right(90)
  42. t.circle(240,-90)
  43. t.end_fill()
  44. t.penup()
  45.  
  46. t.setposition(190,-194)
  47. t.pendown()
  48. t.begin_fill()
  49. t.color("#ff0000")
  50. t.pencolor("#ff0000")
  51. t.right(140)
  52. t.fd(30)
  53. t.right(-94)
  54. t.circle(300,200)
  55. t.right(-90)
  56. t.fd(30)
  57. t.right(90)
  58. t.circle(269,-200)
  59. t.end_fill()
  60. t.penup()
  61.  
  62. t.setposition(-30,298)
  63. t.pendown()
  64. t.begin_fill()
  65. t.color("#330000")
  66. t.pencolor("#330000")
  67. t.right(218)
  68. t.circle(300,235)
  69. t.right(90)
  70. t.fd(30)
  71. t.right(270)
  72. t.circle(330,-235)
  73. t.right(-90)
  74. t.fd(30)
  75. t.end_fill()
  76. t.penup()
  77.  
  78. #face upper part
  79. t.setposition(0,140)
  80. t.pendown()
  81. t.begin_fill()
  82. t.color("#ffbf00")
  83.  
  84. p1=[(-30,140),(-60,220),(-110,200),(-140,180),(-140,110),(-130,60),(-150,30),(-130,
  85.     10),(-115,30),(-30,0),(10,0),(10,0),(30,0),(120,30),(130,5),(150,25),(140,55),
  86.     (150,110),(150,170),(110,200),(60,220),(30,140),(0,140)]
  87.  
  88. for pos in p1:
  89.     x,y=pos
  90.     t.setposition(x,y)
  91. t.end_fill()
  92. t.penup()
  93.  
  94. #face middle part
  95. t.setposition(0,-10)
  96. t.pendown()
  97. t.begin_fill()
  98. t.color("#ffbf00")
  99.  
  100. p2=[(-30,-10),(-40,-20),(-80,-25),(-110,-18),(-154,25),(-170,-5),(-170,-20),(-100,
  101.     -140),(-90,-170),(-60,-190),(-46,-170),(0,-170),(0,-170),(54,-170),(65,-190),
  102.     (98,-170),(105,-140),(177,-20),(177,-5),(156,20),(102,-25),(78,-30),(40,-23),
  103.     (30,-10),(0,-10)]
  104.  
  105. for pos in p2:
  106.     x,y=pos
  107.     t.setposition(x,y)
  108. t.end_fill()
  109. t.penup()
  110.  
  111. #face lower part
  112. t.setposition(0,-180)
  113. t.pendown()
  114. t.begin_fill()
  115. t.color("#ffbf00")
  116.  
  117. p3=[(-40,-180),(-60,-204),(-90,-182),(-100,-200),(-65,-230),(-40,-215),(-20,-215),
  118.     (-10,-205),(0,-205),(20,-205),(30,-215),(50,-215),(75,-228),(110,-198),(100,
  119.     -180),(66,-202),(48,-180),(0,-180)]
  120.  
  121. for pos in p3:
  122.     x,y=pos
  123.     t.setposition(x,y)
  124. t.end_fill()
  125.  
  126. turtle.done()
  127.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement