Skip to content

Instantly share code, notes, and snippets.

@fatosmorina
Created June 12, 2022 10:49
Show Gist options
  • Save fatosmorina/4df1bceb9b6c7dfc204f1ebd2a2a7234 to your computer and use it in GitHub Desktop.
Save fatosmorina/4df1bceb9b6c7dfc204f1ebd2a2a7234 to your computer and use it in GitHub Desktop.
my_list = ["First", "Second", "Third element"]
max_length = 0
longest_string = ""
for s in my_list:
if len(s) > max_length:
max_length = len(s)
longest_string = s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment