Linked Questions

Popular Questions

Python: Does the set.add() function not add duplicates?

Asked by At

I have multiple tuples stored in a set, and I'm trying to add two duplicate tuples to the set through a nested for loop which basically iterates through another bunch of tuples and checks for a condition in the tuple, then adds the tuple to the set if the tuple meets the condition. However, some tuples are duplicate and I'm noticing the duplicates aren't being added.

Related Questions