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
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.
# Drawing heart in python import turtle heart = turtle.Turtle() turtle.speed('fastest') def curve(): for i in range(200): heart.right(1) heart.forward(1) def draw(): heart.fillcolor('red') heart.begin_fill() heart.left(140) heart.forward(113) curve() heart.left(120) curve() heart.forward(112) heart.end_fill() draw() heart.ht() turtle.done()