[Tutor] odd
Ian Witham
witham.ian at gmail.com
Thu Jul 19 03:06:12 CEST 2007
from Guido's tutorial:
The given end point is never part of the generated list; range(10) generates
a list of 10 values, the legal indices for items of a sequence of length 10.
It is possible to let the range start at another number, or to specify a
different increment (even negative; sometimes this is called the `step')
On 7/19/07, elis aeris <hunter92383 at gmail.com> wrote:
>
> I ran this
>
>
> for x in range(5,10):
> print x
>
>
>
>
> and OP was
>
> 5
> 6
> 7
> 8
> 9
>
>
>
> why is that? shouldn't it print
>
>
> t
> 6
> 7
> 8
> 9
> 10?
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070719/77652350/attachment.html
More information about the Tutor
mailing list