-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass5.py
More file actions
56 lines (43 loc) · 798 Bytes
/
Class5.py
File metadata and controls
56 lines (43 loc) · 798 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
45
46
47
48
49
50
51
52
53
54
55
56
import turtle
turtle.speed(speed="fastest")
t = turtle.Turtle()
scale = 0.3
turtle.bgcolor("skyblue")
def cir(col,rad):
t.color(col)
t.begin_fill()
t.circle(scale*rad)
t.end_fill()
def go(x,y,offset):
t.penup()
offx = 60*offset+scale*x
t.goto(offx,scale*y)
t.pendown()
for i in range(-5,5):
#Ears
go(-70,180,i)
cir("black",30)
go(70,180,i)
cir("black",30)
#Face
go(0,70,i)
cir("white",80)
#Eyes
go(-36,150,i)
cir("black",16)
go(36,150,i)
cir("black",16)
go(-36,154,i)
cir("white",8)
go(36,154,i)
cir("white",8)
#Nose
go(0,110,i)
cir("black",10)
#Mouth
t.right(90)
t.circle(scale*10,180)
go(0,110,i)
t.circle(scale*10,-180)
t.left(90)
t.hideturtle()