The following is a piece of code that anyone with Python 3.0+ installed can run. It’s a short, simple animation. You can click on “Run” to preview what it does.
The code is as follows.
import turtle
import time
pen = turtle.Turtle()
pen.hideturtle()
pen.color('red')
pen.width(10)
pen.up()
pen.setpos(0, -50)
pen.down()
def draw_heart():
pen.fillcolor('pink')
pen.begin_fill()
pen.left(140)
pen.forward(230)
for i in range(100):
pen.right(2)
pen.forward(4)
pen.left(120)
for i in range(100):
pen.right(2)
pen.forward(4)
pen.forward(220)
pen.end_fill()
def text():
pen.up()
pen.color('red')
pen.setpos(-100, -150)
time.sleep(1)
pen.write("I LOVE YOU", font=(
"Ink Free", 24, "bold"))
draw_heart()
text()
time.sleep(10)