Write a function longest which examines the argument list l


Problem

Write a function longest(L) which examines the argument list L and returns the longest string. You can assume all of the elements of the list L are strings, and that the list is not empty. Use the approach where there is a variable largestyet which is initialized to the first element of L. Then go through the rest of the elements and update largestyet whenever you encounter a longer string. For example" longest(['blue', 'red', 'the white house', 'green']) would return 'the white house'.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Write a function longest which examines the argument list l
Reference No:- TGS03268219

Expected delivery within 24 Hours