Question: 7-3: Sum of Cubes (Python) Write a program that finds the sum of the cubes of the first n natural numbers. You should have 2
7-3: Sum of Cubes (Python)
Write a program that finds the sum of the cubes of the first n natural numbers. You should have 2 different programs,
one written with a for loop and one written with a while loop.
Test code:
print(sum_of_cubes(10))
print(sum_of_cubes(20))
print(sum_of_cubes(100))
Sample run:
3025
44100
25502500
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
