fbpx

Draw Heart ❤️ in Python with Turtle Graphics | Python Code for Heart Shape

3.7
(3)

In today’s article, we will tell you how to make a Heart ❤️ shape using Turtle inside Python and how to write text in it. If you like it then share it.

Let’s Start

import turtle
turtle.hideturtle()
pen = turtle.Turtle()

def curve():
	for i in range(200):
		pen.right(1)
		pen.forward(1)

def heart():
	pen.fillcolor('red')
	pen.begin_fill()
	pen.left(140)
	pen.forward(113)
	curve()
	pen.left(120)
	curve()
	pen.forward(112)
	pen.end_fill()

def txt():
	pen.up()
	pen.setpos(-42, 90)
	pen.down()
	pen.color('white')
	pen.write("RakeshMgs", font=("Arial", 12, "bold"))
	
heart()
txt()
pen.ht()
turtle.exitonclick()

Preview

Heart Shape
Draw Heart ❤️ in Python with Turtle Graphics | Python Code for Heart Shape 3

if you like Draw Heart ❤️ in Python with Turtle Graphics | Python Code for Heart Shape share to your friends

How useful was this post?

Click on a star to rate it!

Average rating 3.7 / 5. Vote count: 3

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply