3 ms·
I'd expand on #9. It's generally faster and more readable to use an idiomatic Python iteration than to use indexing inside the loop. The difference was small o
by msellout 12y ago
I'd expand on #9.
It's generally faster and more readable to use an idiomatic Python iteration than to use indexing inside the loop. The difference was small over 5 elements, but `enumerate(a)` will become dramatically faster than `range(len(a))` if you have a large list. A better comparison would be `enumerate` vs `xrange`.