Coroutine that prints counters and saves it in a global variable.
()
| 21 | |
| 22 | |
| 23 | async def print_counter() -> None: |
| 24 | """ |
| 25 | Coroutine that prints counters and saves it in a global variable. |
| 26 | """ |
| 27 | while True: |
| 28 | print(f"Counter: {counter[0]}") |
| 29 | counter[0] += 1 |
| 30 | await asyncio.sleep(3) |
| 31 | |
| 32 | |
| 33 | async def interactive_shell() -> None: |