Python: Does the set.add() function not add duplicates? -
i have multiple tuples stored in set, , i'm trying add together 2 duplicate tuples set through nested loop iterates through bunch of tuples , checks status in tuple, adds tuple set if tuple meets condition. however, tuples duplicate , i'm noticing duplicates aren't beingness added.
a set can not contain duplicates. point of set. if want duplicates, consider using list instead.
python set
No comments:
Post a Comment