On Sat, May 16, 2009 at 4:10 PM, Stochastix <laurent.decreusef...@gmail.com> 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 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 -~----------~----~----~----~------~----~------~--~---