A tiny Python program that uses the built-in turtle module to draw a spirograph-style pattern: 100 circles of radius 100, each rotated by 10°, with a new random RGB color every turn.
- Draws concentric/overlapping circles, producing a spirograph effect.
 - Picks a new random RGB color for each circle.
 - Uses the fastest turtle speed for quick rendering.
 - Keeps the window open until you click.
 
- 
Set up a
Turtlenamedtim, enable 0–255 RGB mode withturtle.colormode(255), and set speed to"fastest". - 
Define
random_color()to return a random(r, g, b)tuple. - 
Loop 100 times:
- Change the pen color to a new random color.
 - Draw a circle of radius 
100. - Rotate the turtle’s heading by 
10degrees (setheading(heading + 10)). 
 - 
Wait for a mouse click to close the window.
 
- Python 3.8+ (any recent Python 3 works)
 - No external dependencies (uses the standard library)
 
Save the script as spirograph.py, then run:
python spirograph.pyOn some systems you may need:
python3 spirograph.pyClick the window to exit when you’re done admiring the art.
Tweak these values to change the look:
- 
Number of circles Increase or decrease the loop count:
for _ in range(120): # was 100
 - 
Circle size (radius)
tim.circle(80) # was 100
 - 
Rotation step (degrees per circle) Smaller steps create denser patterns; larger steps are more star-like:
tim.setheading(tim.heading() + 5) # denser tim.setheading(tim.heading() + 15) # sparser
 - 
Speed
"fastest"is ideal, but you can slow it down to watch the drawing:tim.speed(10) # 1 (slow) to 10, or "fastest"
 - 
Color strategy Replace
random_color()with a palette or gradient for themed visuals. 
- Blank/hidden window: Some IDEs buffer the turtle window behind others—look for a new window or run from a terminal.
 - Slow rendering: Keep 
"fastest", reduce the loop count, or increase the rotation step. - Colors look muted: Ensure 
turtle.colormode(255)is called before setting RGB colors. 
spirograph.py— the drawing script (your code).
- This program uses only Python’s standard library—great for quick demos or teaching graphics fundamentals.
 - MIT License
 
Enjoy making mathematical doodles come alive!