On Thu, Dec 8, 2011 at 5:24 PM, Eric Kangas <eric.c.kan...@gmail.com> wrote:
> Now that I have code ready. There is another issue that I found. I
> need to figure out how to find a set sequence of numbers in the list.
> I know in mathematica there is a function called take which allows for
> you to display a partial list from a to b in the list, but I don't see
> that option available in sage. I tried pop, and index those list
> functions aren't useful to me.

You'll just want to use Python's indexing:

sage: f = range(10); f
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: f[2:6]
[2, 3, 4, 5]

Note that it is different than Mathematica in that the indexing is
0-based and the it does not include the "right endpoint".

--Mike

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to