Explore

Close
Turtle Programs Share

Python Program To Draw Thor Hammer

Python Program To Draw Thor Hammer

Looking for a tutorial on how to draw thor hammer in python, then you are at the right place today. In this tutorial, I will show you how to draw thor hammer using python turtle, so follow this tutorial till the end.

Thor is a mightly superhero from marvel and he has a very powerful weapon which is a hammer called mjolnir it is very powerful and awesome so I have decided to draw mjolnir in python.

We will use the turtle module to draw thor hammer in python. It is a GUI python library which can be used to draw anything from characters, cartoons, shapes and other objects.

Python Code To Draw Thor Hammer


import turtle as tur 

tur.bgcolor("#eeeeee")
tur.pensize(2)
tur.color('lightgrey')
tur.pencolor('black')
tur.begin_fill()
tur.seth(-120)
tur.forward(60)
tur.left(90)
tur.forward(120)
tur.left(90)
tur.forward(60)
tur.left(90)
tur.forward(120)
tur.left(45)
tur.forward(10)
tur.left(45)
tur.forward(55)
tur.left(45)
tur.forward(10)
tur.left(45)
tur.forward(120)
tur.left(45)
tur.forward(10)
tur.left(45)
tur.forward(55)
tur.left(45)
tur.forward(10)
tur.backward(10)
tur.right(45)
tur.backward(55)
tur.right(45)
tur.backward(10)
tur.left(30)
tur.backward(30)
tur.left(105)
tur.forward(105)
tur.right(75)
tur.forward(30)
tur.left(35)
tur.forward(10)
tur.left(145)
tur.forward(34)
tur.left(45)
tur.forward(8)
tur.left(30)
tur.forward(103)
tur.left(30)
tur.forward(10)
tur.left(45)
tur.forward(34)
tur.backward(34)
tur.left(135)
tur.forward(10)
tur.right(30)
tur.forward(40)
tur.right(90)
tur.forward(20)
tur.backward(180)
tur.left(90)
tur.forward(15)
tur.right(90)
tur.forward(180)
tur.hideturtle()

tur.done()

Above is the python program to draw thor hammer. Now to run this program you need to have python installed on your computer, If you don’t have then follow this guide: Install and setup python on your computer.

To run this python program, follow the below steps:

  • Create a new folder for this python project.
  • Open it in a code editor of your choice.
  • Create a python file with an ending .py extension.
  • Copy the above code and paste it in your file.

Now you have the code, but there is one last thing you need to do as I have said I have used the turtle library for this program so you might need to install it if you get any errors like turtle module not found.

Turtle comes pre-installed with python setup, but if you get any errors you can install it using the below command.


pip install turtle

So now you have everything setup and you are ready to run the program, so to run this program open a command prompt at your program folder location and paste the below command.


python filename.py

The above command will run the program and it will open a new window and it will start drawing thor hammer and below is the finished drawing of thor hammer.

Thor Hammer Drawing In Python

As you can see, we successfully drew thor hammer using python turtle. I hope you were able to run this program successfully. 

Want more amazing turtle tutorials like this check out this: Awesome Python Turtle Codes.

Don’t want to create all the files and folders then you can run this program now using this online python compiler it is fast and easy.

Summary

This was the tutorial on drawing thor hammer in python programming. I hope you found this tutorial helpful and useful. Do share this tutorial with your friends who might be interested in this program.

Here are some more python drawing tutorials for you:

I hope you found what you were looking for from this tutorial, and if you want more python guides and tutorials like this, do join our Telegram channel for future updates.

Thanks for reading, have a nice day 🙂