How to sort this without 'cmp=' in python 3?
380162267qq at gmail.com
380162267qq at gmail.com
Sat Oct 15 13:30:48 EDT 2016
在 2016年10月14日星期五 UTC-4下午7:35:08,38016... at gmail.com写道:
> nums=['3','30','34','32','9','5']
> I need to sort the list in order to get the largest number string: '953433230'
>
> nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True)
>
> But how to do this in python 3?
>
> Thank you
!!!!!I learn more new tricks in Python. Thank you all of you guys.
You are all very kind helpful and knowledgeable.
More information about the Python-list
mailing list