Welcome to my blog :)

Create a unique and beautiful blog quickly and easily.

Smital Desai

iter function with sentinnel

Hello Pythonistas, did you know that Python iter function has a two arg variant ? iter(func, sentinnel)However the func - must be a zero argument callable. for _ in iter(func, sentinnel): do_something()In this case, loop will run only till func produces the sentinnel value. In…

Continue reading...