0
Does generator create the list first or it returns by demand?
1 Réponse
+ 2
Second. The great power of generators - that we don't need to wait until it create all it's values. Generator creates next value in real-time. This allow us to deal with sequences of values which are infinite (f.e Fibonacci numbers or prime numbers), which we can't do using iterable objects, like lists, sets, dictionaries etc.