Python Program to find Sum of Squares of first n natural numbers

This python program accepts a positive integer n from user and calculates the sum of squares up to n as
12 + 22 + 32 + .... + n2.

For example: If n = 5 then 12 + 22 + 32 + 42 + 42 = 55

Python program to find the sum of squares of first n natural numbers

def sumOfSquares(n) :
    sum = 0
    for i in range(1, n+1) : 
        sum = sum + (i * i) 
    print("Sum of squares of first",n, "natural numbers is",sum)

n = 5
# un comment below code to accept number from user
# n = int(input("Enter any positive integer: "))
sumOfSquares(n)

Output:

Sum of squares of first 5 natural numbers is 55