[Tutor] for loop issue

Oxymoron moron.oxy at gmail.com
Fri Oct 9 12:39:42 CEST 2009


On Fri, Oct 9, 2009 at 9:35 PM, Oxymoron <moron.oxy at gmail.com> wrote:
> Thus, you can muck around with x[i] (current item), and x[i+1] (next
> item), and decide how you want to proceed with the loop. Note the use
> of len(x) - 1 rather than just len(x) to easily prevent an IndexError
> or extra special case logic.

"easily prevent an IndexError without extra special case logic". It's
been a long week.

-- Kamal

-- 
There is more to life than increasing its speed.
 -- Mahatma Gandhi


More information about the Tutor mailing list