Python – Draw “GFG” logo using Turtle Graphics

Prerequisites: Turtle Programming in Python

Turtle is a Python feature like a drawing board, which let us command a turtle to draw all over it! We can use many turtle functions which can move the turtle around. Turtle comes into the turtle library. The turtle module can be used in both object-oriented and procedure-oriented ways.

Some of the commonly used methods are:

  • forward(length): moves the pen in the forward direction by x unit.
  • backward(length): moves the pen in the backward direction by x unit.
  • right(angle): rotate the pen in the clockwise direction by an angle x.
  • left(angle): rotate the pen in the anticlockwise direction by an angle x.
  • penup(): stop drawing of the turtle pen.
  • pendown(): start drawing of the turtle pen.

In this article, we will be drawing the logo of GeeksforGeeks which looks like this – 
 

gfg-logo

 



Approach :

 

  • Importing Turtle.
  • Forming a window screen with size and color.
  • Then start to draw the logo:
    • Form ‘C’ in the backward direction
    • line 90 degree up
    • line 90 degree right
    • line 90 degree down
    • Form ‘C’ in forwarding direction

 

Below is the implementation.

 

Python3

# importing turtle for graphics
import turtle

# Forming the window screen
tut = turtle.Screen()

# background color green
tut.bgcolor("White")

# object
pen = turtle.Turtle()

#speed of pen
pen.speed(10)

# object color
pen.color("Green")

# object width
pen.width(10)
tut = turtle.Screen()


# Code for symbol
# backward C
for x in range(180):
    pen.forward(1)
    pen.right(1)

# up
pen.right(90)
pen.forward(50)

# right
pen.right(90)
pen.forward(130)

# down
pen.right(90)
pen.forward(50)
pen.left(90)

# forward C
for x in range(180):
    pen.backward(1)
    pen.right(1)

turtle.done()


<\/div>

 
Output :
 

gfg logo

 

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : pulkitagarwal03pulkit

Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.