ExamVeda
Login
Home
Generators and Iterators
?

How is a coroutine defined in Python using the async keyword?

Answer & Solution
Correct Answer: Option C
The correct answer is Option C: async def.
In Python, a coroutine is defined using the async def syntax. This keyword combination indicates to the interpreter that the function is a coroutine, allowing it to use asynchronous features such as await expressions and yield statements within the function body. The async def syntax is specifically designed for defining coroutines, providing a clear and concise way to declare asynchronous functions in Python.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.