Junior — Senior
Order of output and passing arguments in asyncio
livecode
Task condition
Analyze the order in which messages will appear in the console and what value will be passed to the data parameter of the test_2 function when running the code below. Check if the order indicated in the comment matches the actual output order.
# asyncio / multiprocessing / threading
async def test_1():
data = await asyncio.sleep(10000000)
print('1')
return data
async def test_2(data):
await asyncio.sleep(1, extra=data)
print('2')
async def main():
data = await test_1()
print('3')
await test_2(data)
asyncio.run(main())