import collectionsd = collections.defaultdict(int)d['a'] = 2d['b'] = 1res = [d.copy() for _ in range(2)]res[0]['a'] -= 1print res[1]
Standard input is empty
defaultdict(<type 'int'>, {'a': 2, 'b': 1})
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!