Pythondex
Turtle Python Programs

Draw Hexagon Using Python Turtle

Published October 23, 2023 by Jarvis Silva

In this tutorial I will show you how to draw hexagon using python turtle, Hexagon is a six side shape and we will use turtle to draw hexagon in python so make sure you have the turtle module installed on your machine, to install use below command:


pip install turtle

After installing, open a code editor and create a python file let’s code in it.

Python code to draw hexagon


import turtle

t = turtle.Turtle()

for i in range(6):
	t.forward(90)
	t.left(300)
	
turtle.done()

Above is the python program to draw hexagon, after running the program below is the output you will get

Hexagon drawing in python

Also Draw Spiral Hexagon In Python Using Turtle

As you can see we successfully drawn a hexagon using python turtle, I hope you found this tutorial helpful and useful, do share it with someone who might need it. Than