Draw Windows logo using Python Turtle

Draw Windows logo using Python Turtle

Welcome friends, in this article we will learn how to draw windows logo using python turtle. This is going to be a very short but interesting article, especially for beginners because we have explained every line of code using comments so that even a beginner can understand the logic very easily.

You can check our website for more articles related to python turtle and its projects. You can use our website’s search bar or you can also visit our home page.

If you want only code, please go to the bottom of the page and copy the code from there using the copy button.

Let’s Draw Windows logo using Python Turtle

1. importing turtle

from turtle import *

2. setting turtle speed and width

speed(1)
width(4)

3. setting background color and turtle color

bgcolor('black')
color('blue')

Here, in the code, begin_fill() means to start filling the shape we are drawing with the color ‘blue’.

In the complete code, penup() means the turtle will not draw anything while it is moving from one coordinate to another, and pendown() means to turtle will draw if it is moving.

4. Drawing the blue color shape

# moving turtle to starting point
goto(-50,60)
pendown()
# going to right top
goto (100,100)
# going to right bottom
goto (100,-100)
# going to left bottom
goto(-50,-60)
# going to starting point
goto(-50,60)

5. Cutting the shape into two halves horizontally

# starting from left middle
goto(-50,0)
pendown()
# ending at right middle
goto(100, 0)

6. Cutting the shape into two halves vertically

# cutting the shape into two halves vertically
# starting from upper middle
goto (25,80)
pendown()
# ending at bottom middle
goto(25,-80)

7. Stopping the turtle with done()

done()

Complete code

# Windows Logo
# importing turtle
from turtle import *
# setting turtle speed
speed(1)
width(4)
# setting background color
bgcolor('black')
# setting color to blue
color('blue')

begin_fill()

penup()

# moving turtle to starting point
goto(-50,60)
pendown()
# going to right top
goto (100,100)
# going to right bottom
goto (100,-100)
# going to left bottom
goto(-50,-60)
# going to starting point
goto(-50,60)

end_fill()

penup()

# setting turtle color to black
color('black')
# changing width of turtle
width(10)

# cutting the shape into two equal halves horizontally

# starting from left middle
goto(-50,0)
pendown()
# ending at right middle
goto(100, 0)

penup()

# cutting the shape into two halves vertically
# starting from upper middle
goto (25,80)
pendown()
# ending at bottom middle
goto(25,-80)

done()

Output

output for the code to draw windows logo

Thank you for reading this article.

Also read:


Share:
Avatar of Harry

Author: Harry

Hello friends, thanks for visiting my website. I am a Python programmer. I, with some other members, write blogs on this website based on Python and Programming. We are still in the growing phase that's why the website design is not so good and there are many other things that need to be corrected in this website but I hope all these things will happen someday. But, till then we will not stop ourselves from uploading more amazing articles. If you want to join us or have any queries, you can mail me at admin@copyassignment.com Thank you