this is seriously boring… after a long effort i finished a code and after submitting it SHOWS ERROR… i mean i have complied my code on my machine but it works fine, but upon submitting it SHOWS ERROR
Code here:
n=int(input(“Enter the range:”))
val=[]
for i in range(0,n):
a=int(input(“Enter number:”))
val.append(a)
pre_sum=0
post_sum=0
for i in val:
pre=int(i/10)
pre_sum=pre+pre_sum
post=i-(pre*10)
post_sum=post+post_sum
print(pre_sum,post_sum)
It is one of the problems that beginners face .
(i) You have to keep proper idenatation . If the code asks for output in new line , you should use \n
or some other code specific function . It may be possible the problem wants some specific output format .
(ii) Don’t confine yourself to the test cases provided with problem statement . Think of the corner cases which can fail the program . Also try testing some random inputs to test the program .
The key is to not loose interest and keep on working towards the solution .