We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc98872 commit 6f9fe14Copy full SHA for 6f9fe14
Coding assignment 9.py
@@ -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