IN this article we will learn how to write “GFG” using Turtle Graphics in Python. For that lets first know what is Turtle Graphics.
- 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.
- import the turtle modules.
- Get a screen to draw on
- Define an instance for turtle.
- for printing G we have to make a semicircle and then complete it by rotating the turtle and moving it forward.
- Then for F move pen up using penup() , then goto() to desired coordinates, then pen it down for drawing using pendown() and draw F.
- for remaining G go to other coordinates and do same as done for 1st G.
Below is the python implementation for the above approach:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course