Question: Write a function called clean that consumes alst, a list of any data type, and returns None. The function mutates alst according to the following

 Write a function called clean that consumes alst, a list of

Write a function called clean that consumes alst, a list of any data type, and returns None. The function mutates alst according to the following Step 1: if a value in alst is a list data type, extract all the values in the list and add each of them to alst Step 2: remove all non-integer values from alst from alst .Step 3: ifalst contains duplicate integers, keep only one of the duplicates, remove the rest For example, L-["cricket", [5,3],2, [2,7,2,8,0,9,1,10,3], True, [4,6],0,1] clean (L) mutates L such that it contains only the following values: 5,7,2,8,0,9,1,10,3, 4,6. Ordering of values in L is irrelevant. Note that alst may not contain a nested list

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!