Python Program for cube sum of first n natural numbers

 21 - Feb - 2022
 XpertPhp
 25

In this example, We will explain to you python program for cube sum of first n natural numbers. so you can see our python example. Example

def sumOfSeries(n):
    sum = 0
    for i in range(1, n+1):
        sum +=i*i*i
    return sum
n = 5
print(sumOfSeries(n))
Output
225