Skip to content

Instantly share code, notes, and snippets.

@wiccy46
Created April 25, 2020 08:13
Show Gist options
  • Save wiccy46/e0fcb47bf8ce9503e61889d8fe8953ef to your computer and use it in GitHub Desktop.
Save wiccy46/e0fcb47bf8ce9503e61889d8fe8953ef to your computer and use it in GitHub Desktop.
[merge_set] Union, merge set #python#algorithms
from operator import or_
from functools import reduce # python3 required
reduce(or_, [{1, 2, 3, 4}, {3, 4, 5, 6}])
# set([1, 2, 3, 4, 5, 6])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment