1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-10-07 13:52:09 +02:00
CodeWars/7kyu/inspiring_strings/solution.py
Matej Focko fc899b0b02
chore: initial commit
Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-12-28 16:19:58 +01:00

10 lines
234 B
Python

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]