Write a program that prints the sum of the even-indexed elements of L, and
minus the sum of the odd-indexed elements of L.
For example:
For list L=[1,2,3,4,5,6] it should print -3, that is (1+3+5)-(2+4+5)
For list L=[1,2,3] it should print 2, that is (1+3)-(2)
Answers
Answered by
1
Answer:
Explanation:
Write a program that prints the sum of the even-indexed elements of L, and
minus the sum of the odd-indexed elements of L.
For example:
For list L=[1,2,3,4,5,6] it should print -3, that is (1+3+5)-(2+4+5)
For list L=[1,2,3] it should print 2, that is (1+3)-(2)
Answered by
1
ANSWER
Explanation:
- I HOPE THIS ANSWER HELP YOU
- FOLLOW ME
- THANKS FOR WATCHING
Attachments:
Similar questions