top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    waclaw_koscielniak
  • Sep 16
  • 1 min read

import asyncio

async def double(x):

await asyncio.sleep(0.05)

return x * 2

async def main():

results = await asyncio.gather(double(3), double(4), double(5))

print(max(results), sum(results))

asyncio.run(main())


[Running] python3 -u "/Users/name/test/test194.py"

10 24

[Done] exited with code=0 in 0.17 seconds



Try to verify it yourself.
Try to verify it yourself.

 
 
 

1 Comment


Guest
Sep 16

Try to run it.

Like
bottom of page