Skip to content

Instantly share code, notes, and snippets.

@zkan
Forked from gatukgl/heart.py
Last active February 14, 2021 15:38
Show Gist options
  • Save zkan/3f12649fa1e698b676fd85a70f442646 to your computer and use it in GitHub Desktop.
Save zkan/3f12649fa1e698b676fd85a70f442646 to your computer and use it in GitHub Desktop.
Drawing heart with turtle in Python
import turtle
turtle.pensize(3)
def draw_heart_curve():
for i in range(200):
turtle.right(1)
turtle.forward(1)
turtle.color("pink", "pink")
turtle.begin_fill()
turtle.left(140)
turtle.forward(111.65)
draw_heart_curve()
turtle.left(120)
draw_heart_curve()
turtle.forward(111.65)
turtle.end_fill()
turtle.color('deep pink')
style = ('Comic Sans MS', 30, 'italic')
turtle.write('Happy Valentine\'s Day', font=style, align='center')
turtle.hideturtle()
turtle.done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment