Draw Windows logo using Python Turtle

 




Hello World, in this newsletter we are able to discover ways to draw Microsoft windows logo  with  the help  of python turtle. This goes to be a totally brief , this is mainly for novices because we  defined each line of code the use of comments (#) in order that even a novice can recognize the common sense very easily. 

 You can surf our website  site for more amazing  articles associated with python turtle and its projects. You can  also surf our website`s seek bar or you could additionally go to our domestic web page.
 
 If you need handiest code, please visit the lowest of the web page and duplicate the code from there the use of the reproduction button.




lets start


Step 1 : importing turtle in python 

           from turtle import*

Step 2. setting turtle's speed and width

           speed(1)
           width(4)

Step3. setting the background color and turtle color

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


Here, what we done 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

Step 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)

Step 5. Cutting the shape into two halves horizontally

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

Step 6. Now 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)

Step 7. Stopping the turtle using  done()

done()


The 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




Post a Comment

0 Comments