Question: IN Python argLongest (L) Write the function argLongest that, given a nonempty list of strings, finds the index of the longest even-length string that ends
IN Python
argLongest (L)
Write the function argLongest that, given a nonempty list of strings, finds the index of the longest even-length string that ends with ing. It takes a list of strings L as input and returns an integer, the index of the longest string in L with a suffix ing of even length. If there are many longest strings, return the index of the first one. If there are no such strings, return the index -1.
Finding the index is more valuable than finding the element: you can quickly retrieve the element using the index, but you cannot quickly retrieve the index using the element. So we want to get in the habit of computing indices of elements, not elements.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
