Javatpoint Logo
Javatpoint Logo

Drawing the Olympic Symbol in Python using Turtle

There is a Turtle module included with Python. It provides a cardboard screen and a turtle(pen) for drawing. Move the turtle(pen) to create anything on the screen. The turtle can be moved with other operations, including forward() and backwards().

We can draw on this using various drawing directions just like we would on a drawing board. The basic commands control how the drawing pen actually moves. We build up from a very basic programme to using Python Turtle to design the Olympic symbol.

Creating the Olympic symbol :

Python Turtle will be used to teach us how to draw the Olympic logo. This post will be both easy to understand and engaging. This is also simple for new novices to understand. By adding comments for something like the lines of code wherever they are necessary, we have simplified this.

Since the logic needed to draw each circle is the same, this code is simple to understand. The colour and x and y coordinates for each circle are the only things that change.

Walking through the code :

Firstly, to use the turtle package's capabilities and methods, use the import function.

Then we created the turtle instance of the object and also set the size of the pen to 6 units using the pensize() method, to draw the Olympic symbol.

Now, we will start with drawing the circles of the Olympic Symbol. For the first circle, we set the colour to blue using the color() method. Then we used the penup() method to lift the pen and dropped it using pendown() method, to the coordinates mentioned below using the goto() method. Lastly, to complete the first circle we set the radius of the circle to 51 units using the circle() method.

For the second circle, we set the colour to black using the color() method. Then we used the penup() method to lift the pen and dropped it using pendown() method, to the coordinates mentioned below using the goto() method. Lastly, to complete the second circle we set the radius of the circle to 51 units using the circle() method.

For the third circle, we set the colour to red using the color() method. Then we used the penup() method to lift the pen and dropped it using pendown() method, to the coordinates mentioned below using the goto() method. Lastly, to complete the third circle we set the radius of the circle to 51 units using the circle() method.

For the fourth circle, we set the colour to yellow using the color() method. Then we used the penup() method to lift the pen and dropped it using pendown() method, to the coordinates mentioned below using the goto() method. Lastly, to complete the fourth circle we set the radius of the circle to 51 units using the circle() method.

For the fifth circle, we set the colour to green using the color() method. Then we used the penup() method to lift the pen and dropped it using pendown() method, to the coordinates mentioned below using the goto() method. Lastly, to complete the fifth circle we set the radius of the circle to 51 units using the circle() method. Along with that, we used the hideturtle() method to hide the turtle(pen) after the completion of the drawing.

Complete code :

Output:

Drawing the Olympic Symbol in Python using Turtle





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA