「Python」set型で集合演算のサンプル

サンプルコード
x = {“a", “b", “c"}
y = {“f", “d", “a"}
z = {“c", “d", “e"}

result = x.union(y, z)

print(result)

実行結果
{'c’, 'd’, 'f’, 'e’, 'b’, 'a’}

Python

Posted by arkgame