Python: String: Longest Word

Write the function longest_word that take a string and returns the longest word in the string. Words are separated by single white-space.


longest_word('we all agreed; it was a magnificent evening.') -> 'magnificent'

Test 1    

Test 2    

Test 3    

Test 4    

Test 5    

Test 6