Question: Rewrite the findItemsInEither function by using sets to simplify it. There is no need to maintain the order of the items in the lists.
Rewrite the findItemsInEither function by using sets to simplify it. There is no need to maintain the order of the items in the lists. def findItemsInEither (list1, list2): list3 = [] for item in list1: if (item not in list3): list3.append(item) for item in list2: if (item not in list3): return list3 list3.append(item)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
