Menu

Hello Thank You In Advance For Your Help I’M A New Computer Science Student Working On An Assignment I’Ve

0 Comment

def deep_list (seq) :
quot;quot;Returns a new list containing elements of the original list that are lists.
gt;gt;gt; seq = [49, 8, 2, 1, 102]
gt;gt;gt; deep_list(seq) gt;gt;gt; seq = [[500] , [30, 25, 24], 8, [0]]
gt;gt;gt; deep_list (seq)
[ [500], [30, 25, 24], [0]]
gt;gt;gt; seq = [quot;helloquot;, [12, [25], 24], 8, [0]]
gt;gt;gt; deep_list(seq)
[ [12, [25], 24], [0]]
return [i if type(x) == list for i in seq]Engineering Technology