On 17.10.2016 23:53, Paul Moore wrote:
On 17 October 2016 at 22:28, Mark Lawrence via Python-ideas
wrote:
How about changing https://wiki.python.org/moin/HowTo/Sorting ?
Good point. Better still, https://docs.python.org/3.6/howto/sorting.html
Don't know what the
[Sven R. Kunze ]
> Indeed. I also didn't know about that detail of reversing. :) Amazing. (Also
> welcome to the list, Alireza.)
It follows from what the docs say, although I'd agree it may be
helpful if the docs explicitly spelled out this consequence (that
reverse=True also
On 17 October 2016 at 22:28, Mark Lawrence via Python-ideas
wrote:
> How about changing https://wiki.python.org/moin/HowTo/Sorting ?
Good point. Better still, https://docs.python.org/3.6/howto/sorting.html
Paul
___
[Alireza Rafiei ]
> I have a list called count_list which contains tuples like below:
>
> > [('bridge', 2), ('fair', 1), ('lady', 1), ('is', 2), ('down', 4),
> > ('london', 2), ('falling', 4), ('my', 1)]
>
>
> I want to sort it based on the second parameter in
On Sun, Oct 16, 2016 at 3:29 PM, Alireza Rafiei
wrote:
> What I ended up doing is:
>
>> count_list = sorted(count_list,
>> key=lambda x: (x[1], map(lambda x: -x, map(ord,
>> x[0]))),
>> reverse=True)
>
>
> which works. Now my