In this article, we are going to learn how to draw the shape of a Diamond using turtle graphics in Python.
Turtle graphics:
- forward(length): moves the pen in the forward 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.
Approach:
- Import the turtle modules.
- Define an instance for the turtle.
- First, make the bigger triangle
- Then make three lines inside the bigger triangle
- Then make 4 small triangles
- Then make one line above these four triangles
Below is the Python implementation of the above approach:
Output:
👁 Image