MCQs > IT & Programming > Python > consider next code import asyncio @asyncio.coroutine def foo1(): yield from asyncio.sleep(3.0) print('1') @asyncio.coroutine def foo2(): yield from asyncio.sleep(1.0) print('2') @asyncio.coroutine def foo3(): print('3') @asyncio.coroutine def test(): asyncio.async(foo1()) asyncio.async(foo2()) asyncio.async(foo3()) yield from asyncio.sleep(2.0) loop.stop() loop = asyncio.get_event_loop() asyncio.async(test()) loop.run_forever() loop.close() What will be printed first?

Python MCQs

consider next code import asyncio @asyncio.coroutine def foo1(): yield from asyncio.sleep(3.0) print("1") @asyncio.coroutine def foo2(): yield from asyncio.sleep(1.0) print("2") @asyncio.coroutine def foo3(): print("3") @asyncio.coroutine def test(): asyncio.async(foo1()) asyncio.async(foo2()) asyncio.async(foo3()) yield from asyncio.sleep(2.0) loop.stop() loop = asyncio.get_event_loop() asyncio.async(test()) loop.run_forever() loop.close() What will be printed first?

Answer

Correct Answer: order is not defined

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it