<AptiCode/>

Question 476: What is the primary advantage of using generators?

tcs
wipro
infosys
general
aptitude
generators

Generators are memory-efficient as they produce values on-the-fly and do not store the entire sequence in memory. This makes them suitable for handling large datasets or infinite sequences without using excessive memory.