Python program for sum of square of N natural numbers

 21 - Feb - 2022
 XpertPhp
 24

In this article, We will explain to you python program for sum of square of N natural numbers. so you can see our python example. Example

def squaresum(n) :
    sm = 0
    for i in range(1, n+1) :
        sm = sm + (i * i)
    return sm
n = 4
print(squaresum(n))
Output
30