Question: Write a recursive function recStrCount() that takes a one-dimensional list as a parameter and returns the number of strings that are found in the list.

Write a recursive function recStrCount() that takes a one-dimensional list as a parameter and returns the number of strings that are found in the list. Recall that you can determine whether an item is a string by writing type(item) == str. The only list functions you are allowed to use are len(), indexing (lst[i] for an integer i), or slicing (lst[i:j] for integers i and j). The following shows several sample runs of the function:

Write a recursive function recStrCount() that takes a one-dimensional list as a

Python 341 Shel Fle Edit Shel Debug Optons Windows Help >>> recStrCountll'one, 2,' three", 4, 'five', 6, 7.5, 8.11, 'nine')) > val recStrCount ([, 2, 3.1415, 4, 5.5, 6]) > val recStrCount (t1) Ln: 44 Col: 4

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!