I have a list that needs to contain a variable number of independent sets. When I run the following piece of code, I want to add the string "testing" to only the first set.
numberOfSets = 3
test = [set()]*numberOfSets
test[0].add("testing")
print test
However, when I print test
, it shows three identical sets that all contain testing. How can I set up my list so I can separately access each set?