< Back

The accumulator pattern appears in a lot of mathematical structures. In this post-lab you will demonstrate your understanding of the accumulator pattern by writing a program to compute the sum of a mathematical series.

Geometric Series

Create a program called geometic_series.py that uses input to get a value n from the user, and computes the sum of the specified number of terms of the series:

$$\frac{1}{1} + \frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \frac{1}{16} + \ldots$$


Submission

Please submit your code on Inquire by Friday, Sept. 16th at noon.