-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShapes using Turtle.py
More file actions
79 lines (72 loc) · 1.23 KB
/
Copy pathShapes using Turtle.py
File metadata and controls
79 lines (72 loc) · 1.23 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
76
77
78
79
import turtle
win = turtle.Screen()
win.bgcolor("green")
a = turtle.Turtle()
a.color("red")
#Creating rectangle
a.left(90)
a.forward(150)
a.left(90)
a.forward(50)
a.left(90)
a.forward(150)
a.left(90)
a.forward(50)
#Creating Square
b = turtle.Turtle()
b.color("blue")
b.pensize(2)
b.forward(100)
b.right(90)
b.forward(100)
b.right(90)
b.forward(100)
b.right(90)
b.forward(100)
b.right(90)
k=turtle.Turtle()
for i in [0,1,2,3]:
k.forward(20)
k.left(90)
p=turtle.Turtle()
for col in ["red","blue","purple","yellow"]:
p.color(col)
p.forward(50)
p.left(90)
#Creating Circle
c = turtle.Turtle()
c.color("orange")
c.pensize(3)
c.begin_fill()
c.circle(100)
c.end_fill()
#Creating Equilateral Triangle
d = turtle.Turtle()
d.color("magenta")
d.pensize(4)
d.left(120)
d.forward(100)
d.left(120)
d.forward(100)
d.left(120)
d.forward(100)
#Creating a Star
e = turtle.Turtle()
e.color("white")
e.pensize(5)
e.speed(10)
for i in range(38):
e.forward(300)
e.left(170)
#Creating Spiral
f = turtle.Turtle()
f.color("red")
f.pensize(4)
dist = 50
angle = 90
for i in range(17):
f.forward(dist)
f.right(angle)
dist=dist+10
angle=angle-3
win.exitonclick()