In this article, we will learn how to make a Hexagon using Turtle Graphics in Python. For that lets first know what is Turtle Graphics.
Turtle is a Python feature like a drawing board, which let us command a turtle to draw all over it! We can use many turtle functions which can move the turtle around. Turtle comes in the turtle library.The turtle module can be used in both object-oriented and procedure-oriented ways.
Some of the commonly used methods are:
- forward(length): moves the pen in the forward direction by x unit.
- backward(length): moves the pen in the backward direction by x unit.
- right(angle): rotate the pen in the clockwise direction by an angle x.
- left(angle): rotate the pen in the anticlockwise direction by an angle x.
- penup(): stop drawing of the turtle pen.
- pendown(): start drawing of the turtle pen.
- Define an instance for turtle.
- For a hexagon execute a loop 6 times.
- In every iteration move turtle 90 units forward and move it left 300 degrees.
- This will make up Hexagon .
Below is the python implementation of above approach.
- Draw Panda Using Turtle Graphics in Python
- Draw Heart Using Turtle Graphics in Python
- Draw Spiralling Circles Using Turtle Graphics in Python
- Python - Draw "GFG" logo using Turtle Graphics
- Draw Rainbow using Turtle Graphics in Python
- Python - Draw Star Using Turtle Graphics
- Python - Draw Octagonal shape Using Turtle Graphics
- Draw Colorful Spiral Web Using Turtle Graphics in Python
- Python - Write "GFG" using Turtle Graphics
- Draw Circle in Python using Turtle
- Draw Cube and Cuboid in Python using Turtle
- Draw Shape inside Shape in Python Using Turtle
- Draw Colored Solid Cube using Turtle in Python
- Draw Ellipse Using Turtle in Python
- Draw Graph Grid Using Turtle in Python
- Draw Dot Patterns Using Turtle in Python
- Draw Chess Board Using Turtle in Python
- Draw Spiraling Star using Turtle in Python
- Draw Spiraling Polygon using Turtle in Python
- Draw Spiraling Square using Turtle in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : anshitaagarwal