Interview Question

What is asyncio?

asyncio provides the standard event loop and tools for asynchronous I/O.

💡 Concept ✅ Quick Revision 🐍 Python

Answer

asyncio is Python’s standard library for event-loop-based asynchronous I/O. β€’ It provides coroutines, tasks, synchronization primitives, subprocess support, and networking APIs. β€’ asyncio.run() is the common entry point for a top-level coroutine. β€’ It is designed for cooperative concurrency rather than automatic parallel execution.

💡 Simple Example

import asyncio async def main(): print('asyncio') asyncio.run(main())

Output

asyncio

⚡ Quick Revision

asyncio provides the standard event loop and tools for asynchronous I/O.