Question: 3. Write a function called findShorterStrings() that accepts a list of strings and a length. The function should return a list that contains only those

 3. Write a function called findShorterStrings() that accepts a list of

3. Write a function called findShorterStrings() that accepts a list of strings and a length. The function should return a list that contains only those strings that are shorter than the length specified. For example: sports = ['hockey', 'scuba diving', 'baseball', 'football', 'table tennis', 'cricket'] words = ['hello', 'collective', 'bicycle','car', 'catalog', 'resources' print (findShorterStrings (sports,10)) #should output the list: ['hockey', 'baseball', 'football', 'cricket'] print (findShorterStrings (sports,5)) #should output an empty list: [] #since there are no items in the list shorter than 5 characters print (findShorterStrings (words, 4)) #should output the list ['car'] Hints: You should create a new, empty list inside your function. Remember that you can add items to a list using the append() function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!