Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 521 Bytes

Square_n_Sum.md

File metadata and controls

34 lines (19 loc) · 521 Bytes

CodeWars Python Solutions


Square(n) Sum

Complete the square sum function so that it squares each number passed into it and then sums the results together.

For example, for [1, 2, 2] it should return 9 because 1^2 + 2^2 + 2^2 = 9.


Given Code

def square_sum(numbers):
    #your code here

Solution

def square_sum(numbers):
    return sum([num*num for num in numbers])

See on CodeWars.com