0
Am having a problem sorting a list of strings, by their lengths in descending order please help
6 Antworten
+ 3
I tried your sample with states.sort(key = len) and it works, other than "Len" → "len" I didn't see any problem.
P.S. I agree with Denise, you should've add the language (Python) on the post "Relevant Tags" section.
+ 1
Can you describe your problem? What have you tried?
A list can sort your length, but you need to know which length belongs to which string.
+ 1
Looks like python (you should tag your language)
Maybe this example will help you:
https://www.sololearn.com/learn/Python/2435/?ref=app
0
@denise. this is an example I have
states=["Nairobi", "Nakuru", " Mombasa", "Lamu"]
I've been trying to use this sort function list.sort(key=Len)
0
my apologies let me look at the link
0
my apologies let me look at the link