Created
September 12, 2017 13:29
-
-
Save abdulateef/047ecac8a8dbb6349ae4e1928f950d9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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