-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lession3_DrawingSquare.py
60 lines (48 loc) · 1.17 KB
/
Lession3_DrawingSquare.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
import turtle
def draw_circle():
angie = turtle.Turtle()
angie.shape("arrow")
angie.color("white")
angie.circle(100)
def draw_triangle():
hey = turtle.Turtle()
hey.shape("classic")
hey.color("black")
hey.forward(100)
hey.left(120)
hey.forward(100)
hey.left(120)
hey.forward(100)
def draw_squares(brad):
count = 0
while(count < 4):
if (count == 0):
brad.shape("arrow")
brad.color("yellow")
brad.speed(3)
elif (count == 2):
brad.shape("turtle")
brad.color("blue")
brad.speed(3)
elif (count == 3):
brad.shape("circle")
brad.color("green")
brad.speed(3)
else:
brad.shape("triangle")
brad.color("black")
brad.speed(4)
brad.forward(100)
brad.right(90)
count = count + 1
def draw_image():
window = turtle.Screen()
window.bgcolor("red")
brad = turtle.Turtle()
for i in range (1, 37):
draw_squares(brad)
brad.right(10)
draw_circle()
draw_triangle()
window.exitonclick()
draw_image()