GH avatar Bite 204. Pomodoro with asyncio

I got an asyncio and type hinting Bite for you.

For this bite, you will be taking a simple Pomodoro timer and refactoring it to utilize asynchronous coroutines with the async and await keywords. You will also need to add type hinting to the code.

It's not the best example of it, but it will give you some hands on practice with how it flows together. The pomodoro code works as is, but the tests will be calling the functions with the async keyword.

The code outputs the following with the dummy data:

Pomodor timer started at: 22:13:56

Session: 1
[1] 22:13:56 Time to work!
[1] 22:13:56 Time for a 0 min break!
[2] 22:13:56 Time to work!
[2] 22:13:56 Time for a 0 min break!
[3] 22:13:56 Time to work!
[3] 22:13:56 Time for a 0 min break!
[4] 22:13:56 Time to work!
[4] 22:13:56 Time for a 0 min break!

Session: 2
[1] 22:13:56 Time to work!
[1] 22:13:56 Time for a 0 min break!
[2] 22:13:56 Time to work!
[2] 22:13:56 Time for a 0 min break!
[3] 22:13:56 Time to work!
[3] 22:13:56 Time for a 0 min break!
[4] 22:13:56 Time to work!

** 22:13:56 Time for lunch! **

Session: 3
[1] 22:13:56 Time to work!
[1] 22:13:56 Time for a 0 min break!
[2] 22:13:56 Time to work!
[2] 22:13:56 Time for a 0 min break!
[3] 22:13:56 Time to work!
[3] 22:13:56 Time for a 0 min break!
[4] 22:13:56 Time to work!
[4] 22:13:56 Time for a 0 min break!

Session: 4
[1] 22:13:56 Time to work!
[1] 22:13:56 Time for a 0 min break!
[2] 22:13:56 Time to work!
[2] 22:13:56 Time for a 0 min break!
[3] 22:13:56 Time to work!
[3] 22:13:56 Time for a 0 min break!
[4] 22:13:56 Time to work!

22:13:56 Time to go home!

Work day completed at: 22:13:56

If ran with the commented code, it would take about 8 hours to complete!

Have fun!

6 out of 7 users completed this Bite.
Will you be Pythonista #7 to crack this Bite?
It takes an average of ~40 minutes to solve this Bite (submissions 5-240 min).

Buy Now Login and get coding
We use Python 3.7