Simple Arithmetic, Input and Output in Python
Drawing Circles with Turtle
How can we improve the n-gon example to draw a chain of rings?
import turtle
import math
turtle.pensize(2)
turtle.speed("fastest")
radius = 80
count = 50
angle = 360/count
edge = radius/10
print(angle)
print(2*math.cos(math.radians((180-angle)/2)))
R = edge/(2*math.cos(math.radians((180-angle)/2)))
print(R)
turtle.penup()
turtle.goto(0, (R))
turtle.pendown()
color = ("red", "green","orange", "purple","blue","pink","black","gray")
for _ in range(count):
turtle.pencolor(color[_ % len(color)])
turtle.circle(radius)
turtle.penup()
turtle.left(angle/2)
turtle.backward(edge)
turtle.left(angle/2)
turtle.pendown()
turtle.done()