-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdraw_name.py
More file actions
75 lines (66 loc) · 1.08 KB
/
draw_name.py
File metadata and controls
75 lines (66 loc) · 1.08 KB
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
import turtle
#def draw_name():
def draw_h(pen):
pen.down()
pen.right(90)
pen.forward(100)
pen.backward(50)
pen.left(90)
pen.forward(50)
pen.right(90)
pen.forward(50)
pen.backward(100)
pen.left(90)
def draw_j(pen):
pen.up()
pen.forward(25)
pen.down()
pen.forward(50)
pen.backward(25)
pen.right(90)
pen.forward(100)
pen.right(90)
pen.forward(25)
pen.right(90)
pen.forward(25)
pen.right(90)
def draw_y(pen):
x = pen.xcor()
y = pen.ycor()
pen.goto(x+25,y-50)
pen.goto(x+50,y)
pen.goto(x+25,y-50)
pen.right(90)
pen.forward(50)
pen.left(90)
def draw_flower(pen):
for i in range(0,36):
for i in range(0,2):
pen.forward(50)
pen.right(60)
pen.forward(50)
pen.right(120)
pen.right(10)
pen.right(90)
pen.forward(200)
def draw_art():
pen = turtle.Turtle()
pen.color("yellow")
pen.shape("turtle")
pen.speed(8)
window = turtle.Screen()
window.bgcolor("red")
draw_h(pen)
pen.up()
pen.forward(10)
draw_j(pen)
pen.up()
pen.goto(170,0)
pen.down()
draw_y(pen)
pen.up()
pen.goto(-100,100)
pen.down()
draw_flower(pen)
window.exitonclick()
draw_art()