[Tutor] range() in 2.1

Andrei Kulakov ak@silmarill.org
Thu, 02 Aug 2001 15:21:26 -0400


On Thu, Aug 02, 2001 at 04:44:29PM +0100, alan.gauld@bt.com wrote:
> A question:
> 
> I am still using Python 2.0 but am reviewing an 
> article which uses Python 2.1. Throughout the article
> the examples consistently act as if range(10) returns 
> the values 1..9 whereas in all the earlier pythons 
> it would return 0..9

Prentice, right? I noticed this too and it is, indeed,
very odd. I have no idea how they got this result -
I use 2.1 and it starts with 0, as it should. Note
that later on they sometimes use range(1, num).
> 
> Have the authors got it wrong or did range() change 
> behaviour in v2.1 - I find that hard to believe! 
> OTOH the examples in the article look like a cut n paste 
> from a terminal session at the >>> prompt (including 
> copyright message etc)
> 
> Puzzled.

Me too.

> 
> Alan G.
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: http://silmarill.org/cymbaline