Created
April 25, 2020 08:13
-
-
Save wiccy46/e0fcb47bf8ce9503e61889d8fe8953ef to your computer and use it in GitHub Desktop.
[merge_set] Union, merge set #python#algorithms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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