get longest shortest word in list python 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'