Calculating pi using a series in my book
<p>I'm trying (yet again) to get better at programming, this time in python, and I've hit a roadblock. I've been trying to figure out why this doesn't work for a while now, so if I could have some help that would be really, really great. I have the instructions as a comment, but the series wouldn't copy to text, it's on wikipedia though as <a href="http://en.wikipedia.org/wiki/Pi#Estimating_.CF.80" rel="nofollow">http://en.wikipedia.org/wiki/Pi#Estimating_.CF.80</a> </p>

<pre><code>#19. Write a program that approximates the value of pi by summing the terms of this series: 
#The program should prompt the user for n, the number of terms to sum
#    and then output the sum of the first n terms of this series.
def pi() :
 n = 0.0
 p = input()
 for i in range(-3,p*4,4):
  n =  n + 4.0 / i - 4.0 / ( i + 2) 
 print n 
</code></pre>

<p>When I say 1000000, it gives me 5.80825432026; that value doesn't change much. Anyway, can someone help me please? At this point I have nothing else I can think of.</p>
