python sort shortest word to longest word in list code example
Example: get longest shortest word in list python
words = ["alpha","omega","up","down","over","under","purple","red","blue","green"]
#GET LONGEST WORD
max(words, key=len)
>>> 'purple'
#GET SHORTEST WORD
min(words, key=len)
>>> 'up'