In this tutorial, we will make you learn about how to Propose Your loved ones using Python Turtle hack. In this, it will create a beautiful heart with a message inside to whom you want to propose in a unique and different way.

Propose Your loved ones using Python Turtle Hack
Block of code:
In this Python Turtle Propose Your loved ones using Python Turtle hack block of code, we will import some libraries from which we can create the heart and write some text inside the heart.
- turt = tur.Turtle() is used to create a turtle object.
- tur.title(“Pythontpoint”) is used to give the title to the window.
from turtle import *
import turtle as tur
# Creating a turtle object(turt)
turt = tur.Turtle()
tur.title("Pythontpoint")
Github Link
Check this code in Repository from Github and you can also fork this code.
Github User Name: PythonT-Point
Block of code:
In this Python Turtle block of code, we will define a method to draw some curves on the screen with the help of a turtle.
- turt.right(1) is used to move the turtle in the right direction.
- turt.forward(1) is used to move the turtle in the forward direction.
def curve():
for i in range(200):
# Defining step by step curve motion
turt.right(1)
turt.forward(1)
Block of code:
In this Python Turtle block of code, we will define a method to draw the heart on the screen.
- turt.fillcolor(‘red’) is used to fill the color inside the shape.
- turt.begin_fill() is used to start filling color.
- turt.left(140) is used to move the turtle in the left direction.
- turt.forward(113) is used to move the turtle in the forward direction.
- turt.left(120) is used to draw the left curve.
- turt.end_fill() is used to stop filling color.
def heart():
# Set the fill color to red
turt.fillcolor('red')
# Start filling the color
turt.begin_fill()
turt.left(140)
turt.forward(113)
curve()
turt.left(120)
# Draw the right curve
curve()
turt.forward(112)
turt.end_fill()
Read: Python Turtle Rose
Block of code:
In this Python Turtle block of code, we will define a method to write the text inside the shape which we draw above.
- turt.up() is used to stop drawing the shape.
- turt.setpos(-68, 95) is used to move the turtle to its absolute position.
- turt.down() is used to start drawing the shape.
- turt.color(‘cyan’) is used to give the color to the turtle.
- turt.write(“I Love You”, font=(“Times New Roman”, 12, “bold”)) is used to write the text inside the shape.
def txt():
turt.up()
turt.setpos(-68, 95)
turt.down()
turt.color('cyan')
turt.write("I Love You", font=(
"Times New Roman", 12, "bold"))
Code:
In the following code, we will import some libraries from which we can draw a beautiful heart on the screen and we can also write some text inside the heart.
- heart() function is used to create or draw the heart on the screen with the help of a turtle.
- txt() function is used to write the text with the help of the turtle inside the image.
- tur.ht() is used to hide the turtle from the screen.
from turtle import *
import turtle as tur
turt = tur.Turtle()
tur.title("Pythontpoint")
def curve():
for i in range(200):
# Defining step by step curve motion
turt.right(1)
turt.forward(1)
def heart():
# Set the fill color to red
turt.fillcolor('red')
# Start filling the color
turt.begin_fill()
turt.left(140)
turt.forward(113)
curve()
turt.left(120)
# Draw the right curve
curve()
turt.forward(112)
turt.end_fill()
def txt():
turt.up()
turt.setpos(-68, 95)
turt.down()
turt.color('cyan')
turt.write("I Love You", font=(
"Times New Roman", 12, "bold"))
# Draw a heart
heart()
# Write text
txt()
# To hide turtle
tur.ht()
tur.done()
Output:
After running the above code, we get the following output in which we can see that the heart is created with the help of a turtle after that the colored text is written inside the shape which looks very beautiful.

So, in this tutorial, we have illustrated How to Propose our loved ones using Python Turtle hack. Moreover, we have also discussed the whole code used in this tutorial.
