✍️How to Draw the YouTube Logo in Python.

preview_player
Показать описание
Want to know how to draw YouTube logo using python, then you are at the right place. Today in this vedioes I will show you step by step how to create this program.

YouTube is one of the most popular video platform, You can find and learn anything from YouTube so today I have decided to create a content vedioes on drawing its logo using python.

We will use the turtle module for creating this program in python, Turtle is a GUI library with the help of this library you can draw anything in python.

Code:-

import turtle as t

t.Screen().bgcolor('yellow')

for i in range(10):

for i in range(65):

for i in range(6):

for i in range(8):

for i in range(10):

for i in range(6):

for i in range(65):

for i in range(10):

for i in range(65):

for i in range(6):

for i in range(8):

for i in range(10):

for i in range(65):

for i in range(6):

for i in range(3):

Above is the python code for drawing the YouTube logo, below is an short and simple explaination of how this code works:

•The code imports all the functions and classes from the turtle module.
•The drawing speed is set to 10 using the speed() function.
•The pen color is set to a shade of blue (#0270d6) using the color() function.
•The screen background color is set to yellow using the bgcolor() function.
•The pen is lifted off the drawing surface using the penup() function, and the turtle’s position is set to (0, 150) using the goto() function.
•The pen is lowered onto the drawing surface using the pendown() function.
•The turtle starts filling a shape using the begin_fill() function.
•A loop is executed four times, where the turtle moves forward by 300 units and then turns 90 degrees to the left while making a partial circle with a radius of -50 units. This creates a square-like shape with rounded corners.
•The turtle moves forward by 150 units to complete the shape and then ends the fill using the end_fill() function.
•The pen color is changed to white using the color() function, and a new shape is drawn by manipulating the turtle’s position and orientation. This shape consists of a combination of straight lines, curves, and angles. The fill color is set to white using the begin_fill() function, and the shape is filled. The turtle hides using the hideturtle() function, and the drawing is completed by calling done(), which closes the turtle graphics window.

You can also try and let me know in comment section your output....

I will give you more ideas and knowledge and project also keep stay with me .

You can also share your friends and your love one . ❤️

I hope you like it and interested code to do.

Thank you 😊

Don't forget to ♥️

❤️Subscribe to my channel for more knowledge and details.

#shortsviral #knowledgeispower #viralshorts #viralreels #codingtips #codingtip #shortsyoutube
Рекомендации по теме