Question: Using recursion that turns 2D (nested) list into 1D list: Ques 7. [14 marks] Write a recursive function the receives a nested list and returns
Using recursion that turns 2D (nested) list into 1D list:

Ques 7. [14 marks] Write a recursive function the receives a nested list and returns a flattened version. Examples: Input: [[1]] - Output: [1] Input: [1, [1]] - Output: [1,1] Input: [1, [1], [[2]], [3,[[[4]]]]] - Output: [1,1,2,3,4] Input: [1] - Output: [1]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
