Skip to content

Instantly share code, notes, and snippets.

@rich-97
Last active November 14, 2016 14:37
Show Gist options
  • Save rich-97/1ff98ed044336310db65ff8d8dbb685d to your computer and use it in GitHub Desktop.
Save rich-97/1ff98ed044336310db65ff8d8dbb685d to your computer and use it in GitHub Desktop.
the longest word in python
string = 'example example2 proof guide'
listStr = string.split()
listLength = [len(i) for i in listStr]
for i in listStr:
if (max(listLength) == len(i)):
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment