LearnPy Hub
← Async Basics problems
Medium

Is the Task Done?

Create one task per input number with asyncio.create_task(work(n)), where work sleeps n/1000 seconds and returns n * 2. Print whether the first task is done right after creating them (it isn't), then await all tasks and print their results and whether every task is done.

Input

One line of small positive integers.

Output

Three lines.

Sample 1

Input
3 1 2
Output
False
6 2 4
True

Sample 2

Input
5
Output
False
10
True
solution.py
Output appears here
Is the Task Done? · Python practice problem · LearnPy Hub