Lab 3 - Calculating the cube root¶

Now that we have some experience setting up a simple Pyhon program, you get to try another similar problem. Instead of the square root, let’s see if we can figure out the cube root.

If X is the number we want the cube root of, and A is our guess, then X should equal A*A*A.

Here is what Newton has to say on the matter:

Start off with some guess for A. Calculate a new guess using this formula:

A = 1/3 *( X/(A*A) + 2 * A)


You might think about why all those parentheses are in there. I want to make sure we ask the computer to evaluate the right value.

Using the example we worked in class, create a new Python program in a file called cuberoot.py. First, write your code to calculate the cube root of 5, just like we did in class.
Place both files in your homework repository, in a folder named Lab3. (Yeah, yeah!, I know. This is a lab, but a short one, so we will put it in the homework repository. Future labs, will have their own personal repositories!)