27 - Generator Expressions ( iterable vs iterator ) | Python Tutorials

preview_player
Показать описание
Learn the difference between an iterable object and an iterator object and how to use a generator expression.

| Language
Python (.py)

| Code Example
Рекомендации по теме
Комментарии
Автор

These guys look a lot like comprehensions from the last video, but the difference is that they only create one item at a time as you call the next() function on them whereas comprehensions will create all the items right off the bat and thus take up a lot more memory.

SimplyCoded
Автор

Question, within a for-loop.. when the __iter__ is called on the the iterable returned as the 'IteraTOR' ? EX: for X in LIST1 <-- in this statement.. will "LIST1' be returned as the Iterator? like so: LIST1 = LIST1.__iter__().

jeff_mci_gaming
Автор

I learn some cool stuff from you, but please take it slow, u seem to rush a bit.

dimitriosdesmos
Автор

this guy tryin to teach generator without the yield keyword

goatboymagic