On Sat, May 16, 2009 at 4:10 PM, Stochastix
<[email protected]> wrote:
>
> I have a list of 2-vectors
>
> (a1,a2), (b1,b2) , ...
>
> I want to sort the vectors according to the following rule
>
> (a1,a2) < (b1,b2) iff a1+b2 < a2+b1
>
>
> Is there a way to do that using the "sort" function ?

Yes and I think this is discussed here:
http://wiki.python.org/moin/HowTo/Sorting

>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to