range Failure?
Oleg Broytmann
phd at phd.pp.ru
Sat Mar 9 17:50:34 EST 2002
On Sat, Mar 09, 2002 at 04:57:56PM -0500, Colin J. Williams wrote:
> It would seem that the first execution below should deliver the same
> result as the second.
No, it is not :)
> >>> range(5, 2)
> []
> >>> range(0, 5, 2)
> [0, 2, 4]
>
> The help has:
> range([start,] stop[, step])
range(5, 2): start = 5, stop = 2, step = 1, result => []
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list