ReferenceSet methods
set.add()
Adds one item, doing nothing if it is already there.
Signature
collection.add(item)Parameters
| Name | Means |
|---|---|
item | must be hashable |
Returns
None.
Example
Python
tags = {"python"}
tags.add("tutorial")
tags.add("python")
print(sorted(tags))Output
['python', 'tutorial']