Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
join two set in python 1

join two set in python

June 23, 2022 by Anurag batra
set1 = {1, 4, 5, 6}
set2 = {1, 2, 3}

set3 = set1.union(set2)
print(set3)

Here is what the above code is Doing:
1. We create two sets, set1 and set2.
2. We use the union() method to combine the two sets.
3. We print the result.

Categories Python Examples
Post navigation
how to make a alert box in python
resample ohlc pandas
© MyEduKit - 2022 . All Rights Reserved.