Question: Python recursion problem 4. Write a recursive function recFloatCount() that takes a one-dimensional list of strings as a parameter and returns the count floats that

Python recursion problem 4. Write a recursive function recFloatCount() that takes aPython recursion problem

4. Write a recursive function recFloatCount() that takes a one-dimensional list of strings as a parameter and returns the count floats that are found in the list. Recall that you can determine whether an item is an int or float by writing type(item) == int, type(item)==float. The only list functions you are allowed to use are len(), indexing (Ist[i] for an integer i), or slicing (Ist[i:]] for integers i and j). In particular, the function should not in any way alter the list passed as a parameter. The following shows several sample runs of the function. You should test with other inputs as well.: >>> print (recFloatCounter (['c','a','t',' ,1.0,'h',1, 'a',2,'t' ,100.2])) 2 >>> print (recFloatCounter(['c',4,8.2, 'a',1,'t',20,5.5])) 2 >>> print (recFloatCounter ([])) 0 >>> print (recFloatCounter(['c','a','t'])) 0

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!