forked from PsTerminator7/Python_Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateHeart.py
More file actions
44 lines (30 loc) · 676 Bytes
/
Copy pathCreateHeart.py
File metadata and controls
44 lines (30 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Importing turtle package
import turtle
pen = turtle.Turtle()
# Defining the curves
def curve():
for i in range(200):
# Defining pointer motion
pen.right(1)
pen.forward(1)
# Defining the method to draw a full heart
def heart():
# Setting color
pen.fillcolor('red')
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()
# Draw the heart
heart()
# To hide turtle
pen.ht()