Given a variable n refers to a positive int value, use two additional variables , k and total to write a for loop to compute the sum of the cubes of the first n counting numbers, and store this value in total. Thus your code should put 1*1*1 + 2*2*2 + 3*3*3 +... + n*n*n into total. Use no variables other than n, k, and total.
n = int(input('input n -> ')) total = 0 for k in range(n+1): total += k*k*k print (total)
Thank you very much! Your assignment helped me greatly! Without your guidance, I would have never been able to do the assignment with such concise detail.
It put me on the right track moving forward. If I need help again, I will be sure to choose your company.