This is not about RTFM, because L1.sort() doesn't produce any result. It
just modifies the original list in place.

I think that Mikie wants to assign the sorted list to another list. In that
case what you need is the sorted command:

sage: L1 = [56,2,4,10]
sage: sort_L1 = sorted(L1)
sage: sort_L1
[2,4,10,56]

On Wed, Jul 15, 2009 at 2:19 PM, Justin C. Walker <jus...@mac.com> wrote:

>
>
> On Jul 15, 2009, at 12:14 , Mikie wrote:
>
> >
> > How does one sort a list in Sage?  I have tried
> >
> > L1=[56,2,4,10]
> > Sort_ = L1.sort()
> >
> > and nothing is produced.
>
> As the saying goes, RTFM :-}
>
> sage: L1=[56,2,4,10]
> sage: L1.sort?
> Type:           builtin_function_or_method
> Base Class:     <type 'builtin_function_or_method'>
> String Form:    <built-in method sort of list object at 0x8a586c0>
> Namespace:      Interactive
> Docstring:
>     L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN
> PLACE*;
>     cmp(x, y) -> -1, 0, 1
> Class Docstring:
>     <attribute '__doc__' of 'builtin_function_or_method' objects>
>
> sage: L1
>  [2, 4, 10, 56]
>
> HTH
>
> Justin
>
> --
> Justin C. Walker, Curmudgeon at Large
> Institute for the Absorption of Federal Funds
> -----------
> If it weren't for carbon-14, I wouldn't date at all.
> -----------
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to