pyassistant

Longest Word in a List

Write a function that takes a list of words (strings) and returns the longest word. If there are multiple words with the same maximum length, return the one that appears first in the list. If the list is empty, return an empty string.

Example:

Input:
(["apple", "banana", "pear", "kiwi"],)
Output:
'banana'

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.