Computer Science, asked by AatmaramTukaramBhide, 4 months ago

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 Callmetony
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 DevHacker61
1

ANSWER

Explanation:

  1. I HOPE THIS ANSWER HELP YOU
  2. FOLLOW ME
  3. THANKS FOR WATCHING
Attachments:
Similar questions