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.

Respuesta :

Answer:

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

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 .
ACCESS MORE
EDU ACCESS
Universidad de Mexico