-
Notifications
You must be signed in to change notification settings - Fork 324
/
Copy patherrorsCircles.py
43 lines (31 loc) · 1.06 KB
/
errorsCircles.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
#CSci 127 Teaching Staff
#October 2020
#A program that draws concentric colored circles, but filled with errors...
#Modified by: ADD YOUR NAME AND EMAIL HERE
improt turtle
import random
print('\nThis program draws concentric circles of many different colors\n")
# prompt for the input
fig_num = int(input("Enter the number of circles to draw: ")
radius = int(input("/nEnter the radius (>=50, <=200) of the largest circle: "))
#set the decrement for each concentric radius
decrement == radius/fig_num
#initialize turtle
tina = turtleTurtle()
# draw fig_num filled concentric circles, randomly changing colors
for j in range[fig_num]
#move the turtle to the -radius y coordinate
tina.up()
tina.goto(0,-radious)
#set a random color
(r,g,b) = (random.random(), random.random(), random.random())
tina.pencolor(r,g,b)
tina.fillcolor(r,g,b)
#draw the circle
tina.down()
tina.begin_fill()
tina.circle(radius)
tina.end_fill()
#decrement the radius for the next concentri circle
radius -= decremen
turtle.Screen().exitonclick()