how to select the shortest item in a python list

Solutions on MaxInterview for how to select the shortest item in a python list by the best coders in the world

showing results for - "how to select the shortest item in a python list"
Thiago
29 Aug 2020
1strings = ["some", "example", "words", "that", "i", "am", "fond", "of"]
2
3print min(strings, key=len) # prints "i"
4
similar questions