Set Operations: Union & Intersection6:55 with AJ Tran
There are four main set operations that allow you to compare and contrast collections like a Venn Diagram. Union and Intersection are two methods for comparing shared membership between sets.
Main Set Operations
The following methods and operations return a new set.
s & t - Return the intersection of two sets as a new set. (i.e. all elements that are in both sets.)
s | t - Return the union of sets as a new set. (i.e. all elements that are in either set.)
You need to sign up for Treehouse in order to download course files.Sign up