set-union

Pythonic way to create union of all values contained in multiple lists

Pythonic way to create union of all values contained in multiple lists Question: I have a list of lists: lists = [[1,4,3,2,4], [4,5]] I want to flatten this list and remove all duplicates; or, in other words, apply a set union operation: desired_result = [1, 2, 3, 4, 5] What’s the easiest way to do …

Total answers: 7