Skip to main content

How to draw github logo using python | draw github logo in python

 



Module:

In this post, we keep it very simple and easy so we will use only one module that is the turtle

Code:

from turtle import *
speed(0)
fillcolor('#211F1F')
begin_fill()
circle(100)
end_fill()
penup()
goto(25,150)
left(170)
pendown()
pencolor('white')
fillcolor('white')
begin_fill()
# head upper part
for i in range(95):
    forward(0.5)
    left(0.2)

# head left part
for i in range(30):
    forward(1)
    left(1)
for i in range(24):
    forward(0.5)
    left(1)
for i in range(17):
    forward(1)
    left(1)
for i in range(17):
    forward(1.7)
    left(0.6)
for i in range(25):
    left(1)
    forward(0.5)
for i in range(24):
    left(1)
    forward(0.5)
for i in range(30):
    left(1)
    forward(1)

# left side of the body
right(125)
for i in range(70):
    forward(0.2)
    left(0.55)
for i in range(58):
    forward(0.5)
    left(0.2)
for i in range(30):
    forward(0.3)
    right(8)
penup()
right(30)
forward(74)
right(90)
forward(10)
left(177)

# righ part of the body
pendown()

forward(6)
for i in range(58):
    left(0.2)
    forward(0.5)
for i in range(70):
    forward(0.2)
    left(0.55)

# head right part
right(125)
for i in range(30):
    forward(1)
    left(1)
for i in range(24):
    forward(0.5)
    left(1)
for i in range(25):
    forward(0.5)
    left(1)
for i in range(17):
    left(0.6)
    forward(1.7)
for i in range(17):
    left(1)
    forward(1)
for i in range(24):
    left(1)
    forward(0.5)
for i in range(30):
    forward(1)
    left(1)
end_fill()
penup()
left(90)
forward(210)
pendown()
fillcolor('white')
begin_fill()
left(90)
circle(45)
end_fill()
penup()
left(110)
forward(97)
right(110)
left(180)
forward(5)
pendown()
fillcolor('white')
begin_fill()
for i in range(35):
    forward(0.5)
    right(1.5)
for i in range(30):
    forward(0.5)
    left(1.5)
for i in range(50):
    forward(0.1)
    left(3)
for i in range(20):
    forward(1)
    right(1)
for i in range(30):
    forward(1)
    left(4)
end_fill()
penup()
forward(127)
pendown()
fillcolor('white')
begin_fill()
for i in range(250):
    forward(0.1)
    left(0.2)
left(70)
for i in range(282):
    left(0.2)
    forward(0.1)
end_fill()
penup()
right(50)
forward(50)
right(60)
pendown()
fillcolor('white')
begin_fill()
for i in range(250):
    forward(0.1)
    left(0.2)
left(70)
for i in range(280):
    left(0.2)
    forward(0.1)
end_fill()
hideturtle()
done()



Github link:-

You can also find the code here

Follow my socials:-

Youtube:https://www.youtube.com/channel/UCU1qNFntn7dCi9uqyvrGKOg

Instagram: https://www.instagram.com/python.math/

Twitter:https://twitter.com/Pritish369



Thank you for giving your time to learn something new in this social traffic🤗

Comments

Popular posts from this blog

Draw Minecraft Charater in Python

  Minecraft  is a  sandbox video game  developed by the Swedish video game developer  Mojang Studios . The game was created by  Markus "Notch" Persson  in the  Java programming language . Following several early private testing versions, it was first made public in May 2009 before fully releasing in November 2011, with  Jens Bergensten  then taking over development.  Minecraft  has since been ported to several other platforms and is the  best-selling video game of all time , with over 238 million copies sold and nearly 140 million  monthly active users  as of 2021 . We gonna build a character of Minecraft using our creativity and coding skills so let's drive into the code: Code: import turtle as t def eye ( r , a ):     t . fillcolor ( 'brown' )     t . begin_fill ()     t . circle ( r , a )     t . end_fill () t . begin_fill () t . fillcolor (...

How To Draw BMW Logo - In Python

 I know I don't need to introduce BMW as it is a very popular luxury car. Today we gonna draw the BMW logo in python. I know that you can draw it using a pencil and other tools like AutoCAD etc. But we are programmers we talk with computers so let's tell our computer to draw this logo for use with the help of python. Module The only module we will use is that turtle Code: import turtle as t t.begin_fill() t.fillcolor( '#008ac9' ) for i in range ( 50 ):     t.forward( 4 )     t.left( 2 ) t.right(- 80 ) t.forward( 116 ) t.right(- 90 ) t.forward( 132 ) t.end_fill() t.penup() t.pendown() t.right( 90 ) for i in range ( 50 ):     t.forward( 4 )     t.left(- 2 ) t.right( 80 ) t.forward( 116 ) t.forward(- 116 ) t.right( 90 ) t.begin_fill() t.fillcolor( '#008ac9' ) for j in range ( 45 ):     t.forward(- 4 )     t.left(- 2 ) t.right(- 90 ) t.forward( 116 ) t.end_fill() t.right( 180 ) t.forward( 116 ) t.right( 90 ) for i in ...

Walking Cat Animation using Pure CSS and HTML

  Showing your creativity with coding is really awesome and fun. This is the post where the creativity is the CSS. So enjoy the code and try to show your creativity. HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>walking Cat</title>     <link rel="stylesheet" href="style.css"> </head> <body>         <div id="marco">           <div id="cielo"></div>                 <div id="luna"></div>                 <div id="gato"></div>                 <div id="muro"></div>       ...