A set keeps unique values without indexes.
Sets remove duplicates and are useful when membership matters more than position.
tags = {"python", "django", "python", "ai"}
print(len(tags))The repeated value appears only once in a set.
Try changing one value, then explain which part of the collection changed and why.
Keep this in mind: Read the collection operation before predicting the result.
tags = {"python", "django", "python", "ai"}
print(len(tags))
print("django" in tags)
tags.add("data")
print("data" in tags)Run the example, then change one value and observe the result.
