[Tutor] range() in 2.1

alan.gauld@bt.com alan.gauld@bt.com
Thu, 2 Aug 2001 16:44:29 +0100


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

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.

Alan G.