P/S:This is not duplicate, I already have an answer myself which map to the answer in the duplicated solution, what I need is the shortest expression that is possible.
l=[set()]*passwordLen
l[0].add(1)
print l
will give result
[set([1]), set([1]), set([1]), set([1]), set([1]), set([1])]
but I need
[set([1]), set(), set(), set(), set(), set()]
what is the shortest expression to create list of sets that could achieve this?
what I could think of is
l=[set() for _ in xrange(passwordLen)]
l[0].add(1)
print l