The turtle is built in library so we don’t need to install separately. We just need to import the library into our Python environment. The Python turtle library consists of all important methods and functions that we will need to create our designs and images. Import the turtle library using the following command.
How To Install Turtle:
pip install turtle
or
pip3 install turtle
turtle is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas. The onscreen pen that you use for drawing is called the turtle and this is what gives the library its name.
from turtle import *
colormode(255)
red = (223, 35, 35)
green = (75, 183, 75)
yellow = (252, 216, 9)
blue = (86, 146, 195)
r = 120
seth(-150)
up()
color(red)
begin_fill()
fd(r)
down()
right(90)
circle(-r, 120)
fd(r * 3 ** .5)
left(120)
circle(2 * r, 120)
left(60)
fd(r * 3 ** .5)
end_fill()
left(180)
color(green)
begin_fill()
fd(r * 3 ** .5)
left(120)
circle(2 * r, 120)
left(60)
fd(r * 3 ** .5)
left(180)
circle(-r, 120)
end_fill()
left(180)
circle(r, 120)
color(yellow)
begin_fill()
circle(r, 120)
right(180)
fd(r * 3 ** .5)
right(60)
circle(-2 * r, 120)
right(120)
fd(r * 3 ** .5)
end_fill()
up()
left(98)
fd(r / 20)
seth(60)
color(blue)
down()
begin_fill()
circle(distance(0, 0))
end_fill()
ht()
done()