pyassistant

Longest String in List

Write a function that takes a list of strings and returns the longest string in the list. If there are multiple longest strings, return the first one encountered.

Example:

Input:
['apple', 'banana', 'kiwi', 'orange']
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.