Question: PYTHON: I started to write this code but I dont understand if I'm supposed to be computing for pi/4 or just pi. My code works
PYTHON:
I started to write this code but I dont understand if I'm supposed to be computing for pi/4 or just pi. My code works for pi.
#inputs the nubmer of terms terms=int(input("Enter number of terms of pi to evaluate:")) #Set counter to 0 seriesSum=0 #Iterates each term for i in range(0,terms): #Adds terms to the series seriesSum +=( pow(-1, i) * ( 1 / ( (pow(((2*i)+3), 3)) - ((2*i)+3) ) ) ); print(4*((3/4)+seriesSum));
Can anyone check my code and confirm this is correct?
Write a well-documented Python program nilakanthapy to implement the Nilakantha series for computing . The Nilakantha series is: -=-+ 4 4 . (2n+3)-(2n+3) The program should accept N, the number of terms in the series. Submit a screen capture of the IDLE depicting your solution for when N-927
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
