Are sets in Python mutable?
In other words, if I do this:
x = set([1, 2, 3]) y = x y |= set([4, 5, 6])
Are x and
x
Sets are muttable
s = {2,3,4,5,6} type(s) s.add(9) s {2, 3, 4, 5, 6, 9}
We are able to change elements of set