python-workout icon indicating copy to clipboard operation
python-workout copied to clipboard

Fix e09b4_even_odd_sums.py to match text problem and add related UT

Open budhadityabanerjee opened this issue 4 years ago • 1 comments

Text problem says: Write a function that takes a list or tuple of numbers. Return a two-element list, containing (respectively) the sum of the even-indexed numbers and the sum of the odd-indexed numbers. So calling the function as even_odd_sums([10, 20, 30,40,50,60]), you’ll get back[90,120].

Current solution does not look at index; rather looks at whether number itself is odd or even.

budhadityabanerjee avatar Apr 09 '21 18:04 budhadityabanerjee

I agree with this, the solution is not using slides. This change is quite good, slides are used here.

eguar11011 avatar Sep 22 '24 16:09 eguar11011