MCPcopy Create free account
hub / github.com/ActiveState/code / unique

Function unique

recipes/Python/81932_Synchronizing_two_lists/recipe-81932.py:9–11  ·  view source on GitHub ↗

Return a list containing all items in 'L1' that are not in 'L2

(L1, L2)

Source from the content-addressed store, hash-verified

7 L.extend(unique_items)
8
9def unique(L1, L2):
10 """Return a list containing all items in 'L1' that are not in 'L2'"""
11 return [item for item in L1 if item not in L2]
12
13# Sample code demonstratiing use
14if __name__ == "__main__":

Callers 1

recipe-81932.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected