Bonjour Nasser, Maybe it is strange, but I find it rather practical. If i, j are indices, this avoids to write i-1, j+1, j+i-1....etc. See what I mean below.
Sébastien L Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> L=range(100) >>> L == L[:45] + L[45:] True >>> L=range(20) >>> i=3;j=9;k=16 >>> L[:i] + L[i:j] + L[j:k] + L[k:] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] >>> On Nov 10, 2:23 pm, Nasser Abbasi <[EMAIL PROTECTED]> wrote: > Hello; > > I was just browsing something to learn about sage, and noticed this on > this web sitehttp://wiki.sagemath.org/sage_mathematica > > where it says: > > "sage: [f(i) for i in range(1, 11)] > [g(1), g(2), g(3), g(4), g(5), g(6), g(7), g(8), g(9), g(10)] > > (note that the endpoint of the range is not included). " > > The above struck me as something that would be confusing and will lead > to many programming errors. I do not program in Python and played > with sage very little. But it seems (to me) strange that when one > write range(i,j) that the sequence will stop at j-1. > > Do other who worked with sage more not find this is a bit odd? > > Nasser --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---