Question: Write a recursive function recDictList() that takes an arbitrarily nested list as a parameter and returns a new one-dimensional list that contains all the dictionaries

Write a recursive function recDictList() that takes an arbitrarily nested list as a parameter and returns a new one-dimensional list that contains all the dictionaries found in the original list. You are not allowed to use any list methods in your function other than indexing (e.g. lst[i] for some integer i), slicing (e.g. lst[i:j] for some integers i and j), len(), or append(). Solutions that use built-in functions rather than recursion to solve the problem will earn very little credit. You should assume that the initial value given to the function is a list, and your function does not have to behave in any reasonable way when given something other than a list as a parameter. The list may contain values of any type and you must only place the dictionaries into the new list. The type() function is helpful in determining what values can be found in the list. The function should not alter the list in any way nor should it make a copy of the list and alter that. The following shows the behavior of the function on some sample parameters. Please remember that these examples are just that. Your function must work correctly on all valid parameters, and you may not make any assumptions about the number of nested sublists or the depth of the nesting in the list provided as a parameter to the function:

This is the output and in python please

Write a recursive function recDictList() that takes an arbitrarily nested list as

Python 3.6.4 Shell File Edit Shel Debug Options Window Help >>> 1st = recDictList([]) >lst st-recDictList (1, 2, 3, 4]) lst >>>1st 1st ['a: 1, 'b': 2, 3), 'd': 411 lst lst >>1st Ln: 133 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!