Skip to content

Turtledemo Module Complexity

The turtledemo package contains demonstration scripts for the turtle graphics module. Not intended for production use.

Operations

Operation Time Space Notes
Import module O(1) O(1) Module load
Run demo O(n) O(n) n = drawing operations

Complexity Notes

Demo complexity varies by algorithm:

# Fractal demos (forest, fractalcurves): O(b^d)
# where b = branches, d = depth

# Simple drawings (peace, bytedesign): O(n)
# where n = number of shapes

# Animations (clock, sorting_animate): O(f × k)
# where f = frames, k = operations per frame

Version Notes

  • All Python 3.x versions: Available as part of turtle module