How to find the shortest string size in array of strings in Python

1 Answer

0 votes
strings = ["c++", "python", "c#", "java", "swift"]

shortest_string_size = len(min(strings, key=len))

print(shortest_string_size)



'''
run:

2

'''

 



answered Mar 7, 2021 by avibootz

Related questions

2 answers 229 views
2 answers 166 views
2 answers 179 views
1 answer 202 views
1 answer 274 views
1 answer 165 views
...