range

Rene Pijlman reply.in at the.newsgroup
Thu Mar 6 03:07:06 EST 2003


Hilbert:
>Why does range(1,4,1) return [1,2,3]?
>It should return [1,2,3,4].

"If step is positive, the last element is the largest start + i
* step less than stop"
       ^^^^^^^^^^^^^^
http://www.python.org/doc/current/lib/built-in-funcs.html#l2h-47

-- 
René Pijlman




More information about the Python-list mailing list