1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-09 11:09:07 +01:00
CodeWars/7kyu/inspiring_strings/solution.py

11 lines
234 B
Python
Raw Normal View History

def longest_word(string_of_words):
words = string_of_words.split(' ')
result = (words[0], len(words[0]))
for word in words:
if len(word) >= result[1]:
result = (word, len(word))
return result[0]