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

Age and Gender Detection In Python - Creation Code

Gender Identity: Gender identity is the personal sense of one's own  gender . Gender identity can correlate with a person's  assigned sex  or can differ from it. In most individuals, the various biological determinants of sex are congruent and consistent with the individual's gender identity.  Gender expression  typically reflects a person's gender identity, but this is not always the case. While a person may express behaviors, attitudes, and appearances consistent with a particular  gender role , such expression may not necessarily reflect their gender identity. The term gender identity was coined by  Robert J Stoller  in 1964. Modules and assets: In this project, we will use the assetsOpenCV library which will help us to play with the camera  We also use some datasets to identify the faces and ages you can find those datasets  here Explanation: We will first train our models test.py import cv2 def faceBox ( net , frame , conf_thresho...

Create Ping Pong Game in Python

  Ping Pong Game: Table tennis , also known as  ping-pong  and  whiff-whaff , is a sport in which two or four players hit a lightweight ball, also known as the ping-pong ball, back and forth across a table using small rackets. The game takes place on a hard table divided by a net. Except for the initial serve, the rules are generally as follows: players must allow a ball played toward them to bounce once on their side of the table and must return it so that it bounces on the opposite side at least once. A point is scored when a player fails to return the ball within the rules. Play is fast and demands quick reactions. Spinning the ball alters its trajectory and limits an opponent's options, giving the hitter a great advantage. We can make it using pygame but I keep it more simple we will create this game using only the turtle module so let's drive into the code without wasting any time Code: # Import required library import turtle # Create screen sc = turtle . Scre...

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 ...