-
Notifications
You must be signed in to change notification settings - Fork 37
/
python-logo.py
53 lines (43 loc) · 875 Bytes
/
python-logo.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
from turtle import Screen, Turtle
def curved_box(t, sides):
for _ in range(sides):
t.circle(90, extent=90)
t.forward(120)
t.circle(90, extent=90)
def snake(t, color):
t.backward(16)
t.left(90)
t.forward(16)
t.right(90)
t.fillcolor(color)
t.begin_fill()
t.forward(64)
curved_box(t, 2)
t.forward(44)
t.left(90)
t.forward(152)
t.right(90)
t.forward(16)
t.right(90)
t.forward(204)
curved_box(t, 1)
t.forward(44)
t.left(90)
t.forward(60)
t.circle(-90, extent=90)
t.forward(64)
t.end_fill()
t.backward(86)
t.left(90)
t.forward(224)
t.dot(48, 'white')
t.backward(224)
t.right(90)
t.forward(86)
screen = Screen()
turtle = Turtle()
turtle.penup()
snake(turtle, '#3774A8')
turtle.left(180)
snake(turtle, '#F6D646')
screen.exitonclick()