Python: from a sentence, find words with even length and return the maximum length word (if there is a tie, return the one that appeared first)
Asked in the Online assessment stage.
Implement max_even_length_word(sentence). The input is a string, and words are separated by whitespace. Return the original word with the greatest even number of characters, or "" if no word has even length.
Examples
"edge node data" returns "edge", because all three words have length 4 and "edge" appears first."fast CDN delivery" returns "delivery", the longest even-length word.Constraints
sentence contains at most 10,000 characters.def max_even_length_word(sentence):