Python 3 Code to Find the Longest Word or String inside List

0Shares

main.py

a_list = ["a_string", "the_longest_string", "string"]
longest_string = max(a_list, key=len)
print(longest_string)
0Shares

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.