Untitled
unknown
plain_text
2 years ago
475 B
8
Indexable
import turtle
# Create a turtle object
heart = turtle.Turtle()
# Move turtle to starting position
heart.penup()
heart.goto(0, 0)
heart.pendown()
# Set pen color and size
heart.color('red')
heart.pensize(3)
# Draw the heart shape
heart.begin_fill()
heart.left(45)
heart.forward(100)
heart.circle(50, 180)
heart.right(90)
heart.circle(50, 180)
heart.forward(100)
heart.end_fill()
# Hide the turtle when done
heart.hideturtle()
# Keep the turtle window open
turtle.done()
Editor is loading...