For this sample program
N = int(raw_input());
n = 0;
sum = 0;
while n<N:
sum += int(raw_input());
n+=1;
print sum;
I have a set of testcases, so I need a python program that invokes the above python program, gives input and should validate the output printed in the console.
raw_input()s with parameters. Also, don't put semicolons at the end of each line. Python doesn't require them.raw_input()to get user input and feed it into your original function. It'll be easier if you separate the logic from the user interaction.