Python Set

Python Set

Set data structure characteristics:
Remove Vs Pop Vs Discard
Set Comprehensions: Python provide a concise way to create set without using map(), filter() or lambda functions. Set comprehension statement consists of an expression followed by a for loop clause, then zero or more for loops or if clauses.
Create a Copy of Set: Set object can not be copied using assignment operator in Python. Assignment operator creates a reference to an existing set object. Copy of a set is sometimes needed so one set(copy) can be changed without changing the content of other set copy.

Create a reference to a existing set : Assignment operator can be used create a reference to an existing set object. If set is referenced, then any change in either of set variable will result in changes in the content of other set(because it is just a reference) as well.
Update Vs Add