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