Python sets
Python sets
Python Sets
s={1,2,3,’abc’}
print(s)
Add and Remove Items/elements in a set.
add() – once a set is created we can only add items to the set.
update() – it is used to add multiple items to a set. It will not guarantee any order ,elements
can be added in any place in set.
union() - it returns new set containing all items from both sets.