What is the main advantage of generators over lists in Python?
Correct answer
B. Lazy evaluation with low memory usage
13 views
B. Lazy evaluation with low memory usage
13 views
Generators yield values one at a time instead of storing the full sequence.
Asked in: Python Interview Advanced Python
https://docs.python.org/3/library/index.htmlNot sure why the answer is B? Ask here and get an explanation.