What is Turtle in Python
Turtle is like a drawing board in Python, which lets us command a turtle to draw over where we have insisted the direction like forward(), backward(), etc.
How to use Turtle
1. We need to import the "Turtle" package
2. We have to create a turtle where we need to control
3. Give direction to draw around using the turtle methods
4. Finally, run turtle.done()
Note:
You can install these libraries using pip command.
import the required package to draw the logo.
Turtle is pre-installed in mostly all programming software if Turtle is not installed please use this pip command pip install PythonTurtle
Source Code:
from turtle import *
bgcolor("yellow")
width(20)
penup()
goto(100,100)
pendown()
fillcolor("white")
begin_fill()
setheading(90)
circle(100,180)
fd(30)
lt(-110)
fd(30)
circle(25,180)
fd(20)
setheading(85)
circle(140,-60)
lt(-65)
circle(250,13)
lt(-70)
fd(15)
lt(90)
fd(52)
setheading(-28)
circle(198,54)
setheading(0)
fd(52)
lt(90)
fd(15)
lt(-70)
circle(250,13)
lt(-65)
circle(140,-60)
setheading(5)
fd(30)
circle(25,180)
fd(30)
lt(-90)
fd(30)
end_fill()
up()
goto(-19.0,-232.0)
down()
color('black')
done() (code-box)
output:
F.A.Qs -
Visual studio code