n = int(input("Number> ")) sum = 0 for i in range(1, n+1): square = i ** 2 # or square = i * i sum = sum + square print(sum)