On 2009-04-01, Lada Kugis <lada.ku...@gmail.com> wrote: > in python for example: > for i in range(1,n) > goes from 1,2,3,4,...,n-1 > (that is, it goes from 1 up to, but not including n) > > Why is that so?
I'm surprised this isn't in the FAQ yet, but it doesn't seem to be there. > What were the reasons for that "not including" part? So that range(n,m) behaves the same as slicing (e.g. similar to someSequence[n:m]) Why does slicing behave that way? So that someSequence[n:m]+someSequence[m:o] == someSequnece[n:o] > It troubles me greatly, Sorry about that. > and I cannot see it's advantages over the "standard" "up to > and including" n. -- Grant -- http://mail.python.org/mailman/listinfo/python-list