Answers for "how to select the shortest item in a python list"

0

how to select the shortest item in a python list

strings = ["some", "example", "words", "that", "i", "am", "fond", "of"]

print min(strings, key=len) # prints "i"
Posted by: Guest on August-16-2021

Code answers related to "how to select the shortest item in a python list"

Python Answers by Framework

Browse Popular Code Answers by Language