LearnPy Hub
← Async Basics problems
Medium

Who Finishes First?

Each input line is name delay_ms. A coroutine sleeps delay_ms milliseconds and then prints the name. Run all of them together with gather; the names come out in order of their delays (all delays are different). Read until END.

Input

Lines, then END.

Output

Names in finishing order.

Sample 1

Input
tea 60
toast 20
egg 40
END
Output
toast
egg
tea

Sample 2

Input
solo 10
END
Output
solo
solution.py
Output appears here
Who Finishes First? · Python practice problem · LearnPy Hub