Skip to content

Instantly share code, notes, and snippets.

@abdulateef
Created September 12, 2017 13:29
Show Gist options
  • Save abdulateef/047ecac8a8dbb6349ae4e1928f950d9b to your computer and use it in GitHub Desktop.
Save abdulateef/047ecac8a8dbb6349ae4e1928f950d9b to your computer and use it in GitHub Desktop.
def longest(words):
tokens = words.split()
max_length = 0
max_word=""
for token in tokens:
if len(token)> max_length:
max_length = len(token)
max_word = token
return max_word
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment