Re:Euler's Fizzbuzz (2020)
by layoutIfNeeded on Tuesday March 16, 2021 @06:33PM
(#26484096)
>Rather than checking an index to see if the loop has reached the end of an iterator, the iterator just raises a StopIteration exception and the runtime catches it.
And how does the iterator know that it should raise an exception? A conditional.
The key lookup in dict definitely has conditionals, though.
Of course, the guy could get rid of that by just using an 11-element array and addressing directly instead of hashing integers as keys.