Question: Python)Implement the function deep_list, which takes in a list, and returns a new list which contains only elements of the original list that are also

Python)Implement the function deep_list, which takes in a list, and returns a new list which contains only elements of the original list that are also lists. Use a list comprehension.

def deep_list(seq): ""

"Returns a new list containing elements of the original list that are lists.

>>> seq = [49, 8, 2, 1, 102]

>>> deep_list(seq) []

>>> seq = [[500], [30, 25, 24], 8, [0]]

>>> deep_list(seq) [[500], [30, 25, 24], [0]]

>>> seq = ["hello", [12, [25], 24], 8, [0]]

>>> deep_list(seq) [[12, [25], 24], [0]] """ "

*** YOUR CODE HERE ***"

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!