Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python sort by length and alphabetically

the_list.sort() # sorts normally by alphabetical order
the_list.sort(key=len, reverse=True) # sorts by descending length
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #sort #length #alphabetically
ADD COMMENT
Topic
Name
3+8 =