Find the intersection (common) of two sets and remove those elements from the first set using python programming
belongs to collection: Python Data Structure Exercises
All Answers
total answers (1)
belongs to collection: Python Data Structure Exercises
total answers (1)
Hint:
intersection()andremove()method of a setSolution:
- Get the common items using the
- Next, iterate common items using a for loop
- In each iteration, use the
need an explanation for this answer? contact us directly to get an explanation for this answerfirst_set.intersection(second_set)remove()method of on first set and pass the current item to it.