Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

intersection() Function of sets in python

# The intersection() function can be used to create a new set containing the shared
# values from one set with another

mySet = {1, 2, 3, 4}
mySet2 = {3, 4, 5, 6}
mySet3 = mySet.intersection(mySet2)
print(mySet3)

# Output:
# {3, 4}
Source by liu-111.medium.com #
 
PREVIOUS NEXT
Tagged: #Function #sets #python
ADD COMMENT
Topic
Name
9+4 =