Write a program that uses asyncio to run three asynchronous tasks concurrently. Each task should print a message and sleep for a different amount of time (e.g., 1, 2, and 3 seconds). Use asyncio.gather to ensure all tasks are run concurrently.
Example output:
Task 1 started
Task 2 started
Task 3 started
Task 1 completed
Task 2 completed
Task 3 completed
Write a program that uses
asyncio
to run three asynchronous tasks concurrently. Each task should print a message and sleep for a different amount of time (e.g., 1, 2, and 3 seconds). Useasyncio.gather
to ensure all tasks are run concurrently.Example output: