+ 1
Can you do .sort with numbers within strings?
Example: array=['6','72','24'] array.sort() So is array now ['6','24','72']? If so.... How can I do the same with: ['Name1:6','Othername:72','Andanother:24'] All help appreciated.
5 Respostas
+ 3
I think that you can put the second array in a dictionary and then try
+ 3
Good luck and tell us if you succeed!
+ 3
There is an explanation here:
https://www.pythoncentral.io/how-to-sort-JUMP_LINK__&&__python__&&__JUMP_LINK-dictionaries-by-key-or-value/
+ 1
Ok I will.
0
One more question for everyone:
How do you sort the values in a dictionary?