loading...

re: Daily Challenge #225 - Square'n'Sum VIEW POST

FULL DISCUSSION
 

I am in love with Python.

square_sum = lambda lst: sum(map(int.__mul__ , *[lst]*2))

print(square_sum([1, 2, 2])) # output -> 9
print(square_sum([1, 2, 3, 4])) # output -> 30
print(square_sum([0, 3, 5, 7])) # output -> 83
print(square_sum([2, 2, 20])) # output -> 408
print(square_sum([])) # output -> 0
code of conduct - report abuse