Draw Iron Man With Python Free source code

Draw Iron Man With Python
Table of Contents

Who is the fan of marvel movies and if you are you will love the iron man tony stark and I am marvel fan too and today I will show you how to draw iron man with python.

If you know or don’t know python don’t worry but you will be able to run this cool project which will draw iron man with python and I will give the source code below you just have to copy and paste.

This project was created by copyassignment website they have a lot of great python projects you can check out – copyassignment website.

Draw iron man with python

Draw iron man with python

Install python

If you have python installed you can skip this section. In order to run python you need to have python installed on your computer. You can download python from here – Download Python. After downloading go through the setup and make sure you select add python to path.

Create a python file

After python installation create a folder with any name and create a app.py file you can name it anything just remember to add .py at the end.

Copy and paste

Now you have created the file open it in any code editor I use vs code you can use any editor and paste this code

				
					import turtle

ankur1 = [[(-40, 120), (-70, 260), (-130, 230), (-170, 200), (-170, 100), (-160, 40), (-170, 10), (-150, -10), (-140, 10),
           (-40, -20), (0, -20)],
          [(0, -20), (40, -20), (140, 10), (150, -10), (170, 10), (160, 40), (170, 100), (170, 200), (130, 230), (70, 260),
           (40, 120), (0, 120)]]
ankur2 = [[(-40, -30), (-50, -40), (-100, -46), (-130, -40), (-176, 0), (-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), (176, 0), (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(500, 600)
turtle.title("I AM IRONMAN")
ankur1Goto = (0, 120)
ankur2Goto = (0, -30)
ankur3Goto = (0, -220)
turtle.speed(2)


def logo(a, b):
    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()
				
			

Run the file

Now inorder to run the file you need to open the command prompt or terminal and type python app.py you should type the name of your file you have created and the program will run and start to draw iron man. You can show it to your friends and enjoy.

				
					#Enter the name of the file
python app.py
				
			

If any errors

If you can’t run the program you get some errors than follow these steps

Summary

So this was the project on how to draw iron man with python. It is really a cool project with turtle. You can draw anything with python turtle.

If you liked this project comment down and share it with your friends and if you want more projects like this subscribe to coderzway newsletter thank you.

Share This Post
Share on facebook
Share on twitter
Share on email
Share on whatsapp

Leave a Reply

Subscribe To Our Newsletter

Get updates and learn from the best

Latest Guides & Articles