Answers for "add two sets python"

3

join two set in python

set1 = {1, 4, 5, 6}
set2 = {1, 2, 3}

set3 = set1.union(set2)
print(set3)
Posted by: Guest on May-17-2020
2

phyton merge two sets

set1 = {"a", "b" , "c"}
set2 = {1, 2, 3}

set3 = set1.union(set2)
Posted by: Guest on March-21-2021
0

same elements of two sets in python

x = {2, 3, 5, 6}
y = {1, 2, 3, 4}

z = x.intersection(y)
Posted by: Guest on May-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language