[Tutor] IndexError: string index out of range

Jacob S. keridee at jayco.net
Wed Nov 3 04:36:40 CET 2004


>q=0
>while q != len(x):
>    print x[q]
>    q= q + 1  (a short hand way to write this is ' q += 1'  subtract
use -=)

Just a quick note. A little while ago, I believe there was a squirmish about
not getting too nit-picky about optimizing the code... but... I would like
to point out that the short hand way of stepping was about 1.5 times slower
when I tested it for all arithmetic operations. :-)

Just pointing it out.
Jacob Schmidt



More information about the Tutor mailing list