forked from souravjain540/Basic-Python-Programs
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython graphics.py
More file actions
Latest commit
23 lines (22 loc) · 560 Bytes
/
Copy pathpython graphics.py
File metadata and controls
23 lines (22 loc) · 560 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importrandom
importturtle
colors= ['violet','indigo','blue','green','yellow','orange','red'] # Added VIBGYOR
t=turtle.Turtle()
t.speed(10)
turtle.bgcolor("black")
length=100
angle=50
size=5
foriinrange(length):
color=random.choice(colors)
t.pencolor(color)
t.fillcolor(color)
t.penup()
t.forward(i+50)
t.pendown()
t.left(angle)
t.begin_fill()
t.circle(size)
t.end_fill()
turtle.exitonclick()
turtle.bgcolor("black")