# Heart turtle for python code very useful and entertaining

**URL:** <https://discuss.python.org/t/heart-turtle-for-python-code-very-useful-and-entertaining/76919>\
**Category:** Python Help\
**Tags:** typing\
**Created:** [January 12, 2025, 7:28pm UTC](https://discuss.python.org/t/heart-turtle-for-python-code-very-useful-and-entertaining/76919 "2025-01-12T19:28:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_rexom23](https://avatars.discourse-cdn.com/v4/letter/_/5f8ce5/32.png) [@\_rexom23](https://discuss.python.org/u/_rexom23)\
**Post date:** [January 12, 2025, 7:28pm UTC](https://discuss.python.org/t/heart-turtle-for-python-code-very-useful-and-entertaining/76919/1 "2025-01-12T19:28:24Z")

</div>

# Import turtle package

import turtle

# Creating a turtle object(pen)

pen = turtle.Turtle()

# Defining a method to draw curve

def curve():  
for i in range(200):

```
	# Defining step by step curve motion 
	pen.right(1) 
	pen.forward(1) 

```

# Defining method to draw a full heart

def heart():

```
# Set the fill color to red 
pen.fillcolor('red') 

# Start filling the color 
pen.begin_fill() 

# Draw the left line 
pen.left(140) 
pen.forward(113) 

# Draw the left curve 
curve() 
pen.left(120) 

# Draw the right curve 
curve() 

# Draw the right line 
pen.forward(112) 

# Ending the filling of the color 
pen.end_fill() 

```

# Defining method to write text

def txt():

```
# Move turtle to air 
pen.up() 

# Move turtle to a given position 
pen.setpos(-68, 95) 

# Move the turtle to the ground 
pen.down() 

# Set the text color to lightgreen 
pen.color('lightgreen') 

# Write the specified text in 
# specified font style and size 
pen.write("GeeksForGeeks", font=( 
"Verdana", 12, "bold")) 

```

# Draw a heart

heart()

# Write text

txt()

# To hide turtle

pen.ht()

---

<div class="post-metadata">

**Author:** ![c-rob](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/c-rob/32/17261_2.png) [@c-rob](https://discuss.python.org/u/c-rob)\
**Post date:** [January 15, 2025, 10:18am UTC](https://discuss.python.org/t/heart-turtle-for-python-code-very-useful-and-entertaining/76919/2 "2025-01-15T10:18:43Z")

</div>

Please format your code properly so people can copy and paste it into their editor of choice.

**Help us help you.** Read this link first and learn how to format code so we can help you better. Do not use a screen shot of your code as some of us will copy and paste the code to get it to work for you, so you can learn from this. [About the Python Help category](https://discuss.python.org/t/about-the-python-help-category/42) You will get more help this way.
