-
Notifications
You must be signed in to change notification settings - Fork 0
/
turtle-draw-tolik.py
57 lines (54 loc) · 1.18 KB
/
turtle-draw-tolik.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
import turtle
def draw_square(some_turtle):
for i in range (4):
some_turtle.forward(100)
some_turtle.right(90)
def draw_art():
window = turtle.Screen()
window.bgcolor('black')
brad = turtle.Turtle()
brad.shape('turtle')
brad.color('white')
brad.pensize(10)
brad.speed(2)
brad.forward(100)
brad.backward(50)
brad.right(90)
brad.forward(100)
brad.color('')
brad.left(90)
brad.forward(100)
brad.color('white')
brad.circle(50)
brad.color('')
brad.forward(60)
brad.color('white')
brad.left(90)
brad.forward(100)
brad.backward(100)
brad.right(90)
brad.forward(50)
brad.color('')
brad.forward(10)
brad.color('white')
brad.left(90)
brad.forward(90)
brad.color('')
brad.forward(10)
brad.right(90)
brad.color('white')
brad.circle(10)
brad.color('')
brad.forward(20)
brad.color('white')
brad.right(90)
brad.forward(100)
brad.backward(50)
brad.left(45)
hypotenuza = (50**2 + 45**2)**0.5
brad.forward(hypotenuza)
brad.backward(hypotenuza)
brad.left(90)
brad.forward(hypotenuza)
window.exitonclick()
draw_art()