66.8k views
0 votes
Assume each of the variables set1 and set2 references a set. Write code that creates another set containing only the elements that are found in both set1 and set2, and assigns the resulting set to the variable set3.

User Yu Fu
by
6.9k points

1 Answer

4 votes

Answer:

Following are the code in python language set3=set1.intersection(set2)

Step-by-step explanation:

In the python proogramming languge the intersection method is used to find the common value in the set .Bascially the intersection method is the operation of the set method .

Following are the description of the above code

  • The set1 is calling the function intersection with passing the pararmeter the of the set2
  • The set3 stores the result of the intersection .
User Ashavan
by
7.2k points