Hi Jason, On Wed, Jan 6, 2010 at 8:22 AM, Jason Grout <[email protected]> wrote: > I'm trying to generate a list of functions where each function returns its > place in a list.
Following Dag Sverre's suggestion: [mv...@boxen ~]$ sage ---------------------------------------------------------------------- | Sage Version 4.3, Release Date: 2009-12-24 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: def func(x): ....: return lambda: x ....: sage: cc = map(func, xrange(10)) sage: cc[0]() 0 sage: cc[1]() 1 sage: cc[2]() 2 sage: cc[-1]() 9 -- Regards Minh Van Nguyen
-- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
