# Tacopy Playground

Tail-Call Optimization for Python - See how your recursive functions get transformed

Input Code Loading Pyodide...
def factorial(n: int, acc: int = 1) -> int: """Calculate factorial using tail recursion.""" if n == 0: return acc return factorial(n - 1, acc * n)
Transformed Code
Waiting for Pyodide to load...

### Examples

How it works: Tacopy transforms tail-recursive functions into iterative loops, eliminating stack overflow risks and improving performance. Learn more on GitHub