"Sum of N numbers: N numbers are given in the input. Read them and print their sum. " - Snackify python coding question
CODING QUESTION
N numbers are given in the input. Read them and print their sum.
The first line of input contains the integer N, which is the number of integers to follow. Each of the next N lines contains one integer. Print the sum of these N integers.
SOLUTION
r=int(input())sum=0
for i in range(r):
sum+=int(input())
print(sum)
Input :
10
1
2
1
1
1
1
3
1
1
1
Output :
13