Skip to main content

Practice ยท 2 of 2

Bounded Retry

Implement retry(fn, attempts) that calls fn() up to attempts times, returning the first successful result. If fn raises, sleep-free retry; when all attempts fail, re-raise the LAST exception.

Difficulty: intermediate

Back to lesson: Practice: Chaining Drills