# Using a for loop to calculate sum of cubes of numbers from 1 to n
n = int(input("Enter the value of n: ")) # Get the value of n from user input and convert it to integer
sum = 0 # Initialize sum as zero
for i in range(1,n+1): # Loop from 1 to n
sum += i**3 # Add i cubed to sum
print("The sum of cubes of numbers from",n,"is",sum) # Print the result
To embed this project on your website, copy the following code and paste it into your website's HTML: