Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 1)
1.
What is a generator?
A function that generates random numbers
An iterable object that allows lazy evaluation of values
A built-in Python module for creating HTML documents
A keyword used for dynamic memory allocation
Answer: Option
Explanation:
In Python, a generator is a type of iterable, similar to a list or tuple, but it allows lazy evaluation of values. It generates values on-the-fly and does not store them in memory all at once, making it memory-efficient.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.