Skip to content

Commit c0c269d

Browse files
committed
Draw smiling face emoji using Turtle in Python
Draw smiling face emoji using Turtle in Python
1 parent de6cf6b commit c0c269d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

main.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
# Python program to draw smile
3+
# face emoji using turtle
4+
import turtle
5+
6+
# turtle object
7+
pen = turtle.Turtle()
8+
9+
# function for creation of eye
10+
def eye(col, rad):
11+
pen.down()
12+
pen.fillcolor(col)
13+
pen.begin_fill()
14+
pen.circle(rad)
15+
pen.end_fill()
16+
pen.up()
17+
18+
19+
# draw face
20+
pen.fillcolor('yellow')
21+
pen.begin_fill()
22+
pen.circle(100)
23+
pen.end_fill()
24+
pen.up()
25+
26+
# draw eyes
27+
pen.goto(-40, 120)
28+
eye('white', 15)
29+
pen.goto(-37, 125)
30+
eye('black', 5)
31+
pen.goto(40, 120)
32+
eye('white', 15)
33+
pen.goto(40, 125)
34+
eye('black', 5)
35+
36+
# draw nose
37+
pen.goto(0, 75)
38+
eye('black', 8)
39+
40+
# draw mouth
41+
pen.goto(-40, 85)
42+
pen.down()
43+
pen.right(90)
44+
pen.circle(40, 180)
45+
pen.up()
46+
47+
# draw tongue
48+
pen.goto(-10, 45)
49+
pen.down()
50+
pen.right(180)
51+
pen.fillcolor('red')
52+
pen.begin_fill()
53+
pen.circle(10, 180)
54+
pen.end_fill()
55+
pen.hideturtle()
56+
57+
pen.screen.mainloop()

0 commit comments

Comments
 (0)