Functions that return an iterator yielding items instead of a list are called _______.
- Decorators
- Generators
- Lambda Functions
- List Comprehensions
Functions that return an iterator yielding items instead of a list are called 'Generators'. Generators are used to generate values on-the-fly and are memory-efficient.
Loading...
Related Quiz
- If you have a break in the inner nested loop, will it terminate only the inner loop or both inner and outer loops?
- For supporting operations like obj[key], the class should define the _______ method.
- When designing a RESTful API, how should you handle versioning of the API?
- Which Python module provides a set of tools for constructing and running scripts to test the individual units of your code?
- Given a scenario where a system should notify a user if the storage space goes below 5% or above 95%. Which of the following combinations of operators will be suitable for the condition?