tags = {"python", "beginner", "python"}Line-by-line explanation
- Curly braces contain the set values.
- Python appears twice in the code.
- The set stores it only once.
tags.add("coding")Line-by-line explanation
- The add method belongs to the set.
- Coding is inserted if it is not already present.
Sets are especially useful for fast membership checks and removing duplicates. They do not promise list-style position order.