def test(x, y=[]): y.append(x) return yprint(test(1))print(test(2))print(test(3, []))print(test(4))
Standard input is empty
[1] [1, 2] [3] [1, 2, 4]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!