Python Program to find sum of array of elements
Array is a collection of similar datatype which are stored in sequencial order. In this post we are going to find sum of the array elements in the array or list.
Input:
1 2 3 4
Output:
10
Explanation:
[1,2,3,4]
sum = 1 + 2 + 3 +4 = 10 (desired output).
Code:
arr=list(map(int,input().split()))
print(sum(arr))
Note:
Hello Guys, Don't Stop Learning keep Going..............