0
Given an array of N integers, can you find the sum of its elements? In python
6 Respuestas
+ 4
a = [1,2,3,4,5]
print(sum(a))
+ 3
Sample Input: 1 2 3 4 5
Sample Output:
Sum of elements is 15
https://code.sololearn.com/c096pcZS24J2/?ref=app
+ 1
You can do it with a loop, while or for
+ 1
incase if it is random integer
0
actually I want to know how to provide input in array
0
No problem with random, you only must to generate it before a loop