To stop iterating over iterator following should be done:
Explanation
__next__ method is called during iteration over iterator. It should raise a StopIteration to signal the end of the iteration

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Python
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести