Advertisement
here2share

# t_heart.py

Feb 15th, 2025
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. # t_heart.py
  2.  
  3. import turtle
  4.  
  5. def draw_heart(n):
  6.     t = turtle.Turtle()
  7.     s = turtle.Screen()
  8.     s.bgcolor('black')
  9.     t.speed(0)
  10.    
  11.     t.penup()
  12.     t.goto(0, -80 * n)
  13.     t.pendown()
  14.  
  15.     t.fillcolor("red")
  16.     t.begin_fill()
  17.    
  18.     t.left(50)
  19.     t.fd(118 * n)  
  20.     t.circle(45 * n, 200)  
  21.     t.lt(221)
  22.     t.circle(45 * n, 200)  
  23.     t.fd(118 * n)  
  24.    
  25.     t.end_fill()
  26.     t.hideturtle()
  27.  
  28. draw_heart(3)
  29.  
  30. turtle.done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement