21. Generators [Python 3 Programming Tutorials]

preview_player
Показать описание
Generators are functions that can be used as iterators. Learn more about them in this tutorial.
Code used in this tutorial:

Next Video:

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

How often Generators are used in real time work as compared to Iterators?

ranjith
Автор

sir, you had said in iterator class that for loop works on iterators, here you are saying for loop works on generators ! Which one is correct?

ramabhishek
Автор

Sir, how can I see source code of python built in function

alokranjansanga
Автор

why we have used while true in the function?
can someone tell?

snigdhchamoli
Автор

Sir, why are writing only yield a and not both a and b in Fibonacci function

pankajchandel
Автор

>>> def remote_control():
yield "CNN"
yield "ABC"
>>> rem = remote_control()
>>> next(rem)
'CNN'
>>> next(rem)
'ABC'
>>> next(reversed(rem))
Traceback (most recent call last):
File "<pyshell#25>", line 1, in <module>
next(reversed(rem))
TypeError: 'generator' object is not reversible

IMPORTANT NOTE !

shreytalreja
welcome to shbcf.ru