x = [[]] * 2x[0].append('a')x[1].append('b')print(x)print(id(x[0]), id(x[1]))
Standard input is empty
[['a', 'b'], ['a', 'b']] 3073306700 3073306700
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!