Skip to main content

Practice · 2 of 2

Sequential Awaits

CHALLENGE
Difficulty: intermediate+25 XP

Implement async def flow() that awaits two steps in order: step_one() returns 1 (after sleeping 0.01), step_two(n) returns n + 1 (after sleeping 0.01); flow returns step_two(step_one's result) — i.e. 2. Provide a sync run_flow() wrapper using asyncio.run.

Back to lesson: Practice: Coroutine Drills