-
Notifications
You must be signed in to change notification settings - Fork 7
/
panda.py
80 lines (65 loc) · 1.16 KB
/
panda.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import turtle
# Creating a turtle object(pen)
pen = turtle.Turtle()
# Defining method to draw a colored circle with a dynamic radius
def ring(col, rad):
# Set the fill
pen.fillcolor(col)
# Start filling the color
pen.begin_fill()
# Draw a circle
pen.circle(rad)
# Ending the filling of the color
pen.end_fill()
# Draw first ear
pen.up()
pen.setpos(-35, 95)
pen.down
ring('black', 15)
# Draw second ear
pen.up()
pen.setpos(35, 95)
pen.down()
ring('black', 15)
##### Draw face #####
pen.up()
pen.setpos(0, 35)
pen.down()
ring('white', 40)
# Draw first eye
pen.up()
pen.setpos(-18, 75)
pen.down
ring('black', 8)
# Draw second eye
pen.up()
pen.setpos(18, 75)
pen.down()
ring('black', 8)
# Draw first eye
pen.up()
pen.setpos(-18, 77)
pen.down()
ring('white', 4)
# Draw second eye
pen.up()
pen.setpos(18, 77)
pen.down()
ring('white', 4)
##### Draw nose #####
pen.up()
pen.setpos(0, 55)
pen.down
ring('black', 5)
##### Draw mouth #####
pen.up()
pen.setpos(0, 55)
pen.down()
pen.right(90)
pen.circle(5, 180)
pen.up()
pen.setpos(0, 55)
pen.down()
pen.left(360)
pen.circle(5, -180)
pen.hideturtle()