You are viewing a single comment's thread. Return to all comments →
Yeah but your missing the point. Firstly a number of people are coming here with little to no experience and this is great practice for them.
The problem is clearly labeled as being easy, however maybe that didn't exist 2 years ago when this post was made.
And for people with more experience, it is an opportunity to play around.
Case in point:
def aVeryBigSum(n, ar):
return reduce(lambda x, y: x + y, ar, 0)
def reduce(func, arr, s):
for v in arr:
s = func(s, v)
can you explain the code. which you provided here.