Ticker

6/recent/ticker-posts

Unique Pattern With Turtle In Python - Pattern 3 (Iron Man Helmet)

  




In this program we are going to make Iron Man helmet design in python using turtle library.

Its super easy to code and so much fun. 

Try out this program and the code is following :



    import turtle

ankur1 = [[(-40120), (-70260), (-130230), (-170200), (-170100), (-16040), (-17010), (-150-10), (-14010),
           (-40-20), (0-20)],
          [(0-20), (40-20), (14010), (150-10), (17010), (16040), (170100), (170200), (130230), (70260),
           (40120), (0120)]]
ankur2 = [[(-40-30), (-50-40), (-100-46), (-130-40), (-1760), (-186-30), (-186-40), (-120-170), (-110-210),
           (-80-230), (-64-210), (0-210)],
          [(0-210), (64-210), (80-230), (110-210), (120-170), (186-40), (186-30), (1760), (130-40),
           (100-46), (50-40), (40-30), (0-30)]]
ankur3 = [[(-60-220), (-80-240), (-110-220), (-120-250), (-90-280), (-60-260), (-30-260), (-20-250),
           (0-250)],
          [(0-250), (20-250), (30-260), (60-260), (90-280), (120-250), (110-220), (80-240), (60-220),
           (0-220)]]

turtle.hideturtle()
turtle.bgcolor('#ba161e')  # Dark Red
turtle.setup(500600)
turtle.title("IRONMAN")
ankur1Goto = (0120)
ankur2Goto = (0-30)
ankur3Goto = (0-220)
turtle.speed(2)


def logo(ab):
    turtle.penup()
    turtle.goto(b)
    turtle.pendown()
    turtle.color('#fab104')  # Light Yellow
    turtle.begin_fill()

    for i in range(len(a[0])):
        x, y = a[0][i]
        turtle.goto(x, y)

    for i in range(len(a[1])):
        x, y = a[1][i]
        turtle.goto(x, y)
    turtle.end_fill()


logo(ankur1, ankur1Goto)
logo(ankur2, ankur2Goto)
logo(ankur3, ankur3Goto)
turtle.hideturtle()
turtle.done()
    

Post a Comment

0 Comments