a=[1,2]a = a+[0]*(4-len(a))print(a)
Standard input is empty
[1, 2, 0, 0]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!