All challenges
Code AnalysisIntermediate 45s

gather concurrent

What is the output?
Starter code
import asyncio
async def f(n):
    await asyncio.sleep(0.01)
    return n
async def main():
    r = await asyncio.gather(f(1), f(2))
    print(sum(r))
asyncio.run(main())

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle