Python – Draw “GFG” logo using Turtle Graphics

Prerequisistes: 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 in 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 window screen with size and color.
  • Then start to draw logo:
    • Form ‘C’ in backward direction
    • line 90 degree up
    • line 90 degree right
    • line 90 degree down
    • Form ‘C’ in forward direction

Below is the implementation.

Python3

filter_none

edit
close

play_arrow

link
brightness_4
code

# importing turtle for graphics
import turtle 
   
  
# Forming the window screen
tut = turtle.Screen()
  
# background color green
tut.bgcolor("green")
  
# window title Turtle
tut.title("Turtle")
  
# object
pen = turtle.Turtle()
  
# object color
pen.color("orange")
  
# object width
pen.width(5)
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)

chevron_right


Output :




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.


Article Tags :

Be the First to upvote.


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