I am looking to understand what purpose a generator serves.
For example, in the following
what is the practical difference between
iter([x for x in range(1,10)])
and
(x for x in range(1,10))
?
why should I use a generator at all?
I am looking to understand what purpose a generator serves.
For example, in the following
what is the practical difference between
iter([x for x in range(1,10)])
and
(x for x in range(1,10))
?
why should I use a generator at all?