Skip to content

Commit 6f9fe14

Browse files
Create Coding assignment 9.py
1 parent dc98872 commit 6f9fe14

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Coding assignment 9.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'''
2+
Code : Array Sum
3+
Given an array of length N, you need to find and print the sum of all elements of the array.
4+
Constraints : 1 <= N <= 10^6
5+
Input Format :
6+
Line 1 : An Integer N i.e. size of array Line 2 : N integers which are elements of the array, separated by spaces
7+
Sample Input :
8+
3
9+
9 8 9
10+
Sample Output : 26
11+
'''
12+
13+
n=int(input())
14+
arr=list(map(int,input().split()))
15+
result=sum(arr)
16+
print(result)

0 commit comments

Comments
 (0)