""" Goal/purpose: This is a debugging exercise to be solved in class. This program attempts to calculate the sums of the cube roots of the integers from 1 to 1,000,000. The correct answer is 75000049.7226595 There are three things wrong with the program. I am leaving out most of the comments that I would normally include becuse I want to make it less obvious what I've done wrong. Please correct these issues. Author: George Gollin File: unit02_in_class_warmup.py Date: June 7, 2017 Physics 298 owl, University of Illinois at Urbana-Champaign """ ################################### # Import libraries ################################### # no libraries are needed ################################### # Define and initialize variables ################################### # the correct value is... correct_value = 75000049.7226595 # Accumulator variable for a sum accumulator_variable = 0 # upper limit variable for the loop last_term = 1000000 ############################################################################### # Loop doing the work. Normally this would be much more thoroughly commented. ############################################################################### for index in range (1, last_term): increment_variable = index ** 1/3 accumulator_variable = accumulator_variable + increment_variable ############################################################################### # End of loop. Print the results. ############################################################################### print("all done. Result is... ", accumulator_variable) print("my value minus the correct value is ", \ accumulator_variable - correct_value) ############################################################################### # Make informative comments on the results you just found, like how quickly # the series converges, and its comparison to the true value of pi. ############################################################################### print("well, that was fun and I am easily amused.")