stopiteration python | python iterators

Publicado em: 16 Novembro 2022
no canal de: Coding Study Point
343
like

StopIteration
The example above would continue forever if you had enough next() statements, or if it was used in a for loop.
To prevent the iteration to go on forever, we can use the StopIteration statement
In the __next__() method, we can add a terminating condition to raise an error if the iteration is done a specified number of times:
Stop after 15 iterations:


Nesta página do site você pode assistir ao vídeo on-line stopiteration python | python iterators duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Coding Study Point 16 Novembro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 343 vezes e gostou like espectadores. Boa visualização!