How iterator differs from generator in Python?
Explanation
Iterator is an object that is used to iterate over a collection of objects.
Generator is a function that returns an iterator. Basically, instead of populating and returning a collection of objects at runtime, it generates and yields only one value per call

@sgh thanks! fixed

2020 Feb 17, 11:30:50 PM

in the question about generator and iterator.. the good answer is opposite to the explanation

2020 Feb 14, 8:57:57 AM

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Python
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты