Python Turtle – Draw a heart ❤️

In this post we will be creating a Python script to draw a heart using the turtle library. The turtle library enables us to a virtual canvas where one can draw an endless number of shapes and pictures. It is especially useful for beginners, children and programmers wanting to have some fun – The library is limited only by imagination.

See the snippet of Python code below where we use the turtle library to draw a heart. If you find this useful be sure to check out some of our other Turtle examples here.

import turtle

# set the turtle's speed

# move the turtle to the starting position
turtle.goto(0, -200)

# draw the first half of the heart
turtle.color("red", "pink")

# draw the second half of the heart, 200)

# fill in the heart
turtle.setheading(60), 200)

# hide the turtle

# keep the window open

The above would output the following to a canvas and leave it open.

Image of heart using turtle library in Python.

If you do create your own, please do share with us as we would love to see! Also be sure to check out some of our other Turtle examples here.

Take a look at some of our other content around the Python programming language by clicking here.

Leave a Reply