How do I write asynchronous functions with async/await?

Asynchronous programming in Python allows you to run multiple operations concurrently, improving the performance of I/O-bound tasks. The `async` and `await` keywords enable the easy definition of asynchronous functions. Here’s how to write asynchronous functions using these keywords.

Keywords: async, await, asynchronous programming, Python async functions
Description: Learn how to implement asynchronous functions in Python using async and await keywords to enhance the performance of your I/O-bound applications.
        import asyncio

        async def fetch_data():
            print("Start fetching data...")
            await asyncio.sleep(2)  # Simulating a network delay
            print("Data fetched!")
            return {"data": "sample data"}

        async def main():
            result = await fetch_data()
            print(result)

        asyncio.run(main())
        

Keywords: async await asynchronous programming Python async functions