Write a program that take an array s as an argument and add all the odd values and display the sum .
In python
Answers
Answered by
0
Answer:
def oddsum(s):
sum=0
for i in s[1::2]:
sum+=i
return sum
n=list(map(int,input().split()))
print(oddsum(n))
Similar questions