Turtle Graphics is a learning environment for Python programming inspired by Logo which is like a board that lets you command a turtle to draw all over the board using certain commands.
Let us import turtle and see how it works.
The turtle shape is a triangle by default. Let us try changing it to a turtle’s body shape.
Let us try drawing a triangle using Turtle.
- turtle.forward(x) makes the turtle go horizontally for x pixels.
- turtle.left(y) makes the turtle turn to a position which is at an angle of y degrees from the initial direction.
Let us now try drawing a cool star.
Please check out more functions using Turtle in the official documentation given in Turtle documentation.
I just tried modifying the star code a little bit and got a different shape.