Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Note : you may not use list comprehensions or similar Python constructs not taught yet in this course. Use while loops (or for loops, except
Note: you may not use list comprehensions or similar Python constructs not taught yet in this course. Use while loops (or for loops, except while required in Q4) for iteration. You may not use any string methods other than .lower()
this is a python work, i don't know how to do this, i need you help, thanks you very much!
4. Pi is an irrational number whose first digits are: 3.1415928. The precise value of pi is equal to the infinite sum: pi = 4/1-4/3 + 4/5-4/7 + 4/9-4/11 + You can compute better and better approximations of pi by computing more terms of the series. Write function approxPi(deltaValue) that computes and returns an approximation of pi. Use a while loop (not a for loop) Each iteration should update the pi approximation by including one additional term from the series. The loop should terminate when the difference between the previous iteration's approximation and the new iteration's approximation is less than deltaValue. For example approxPL(.01) 3.1465677471829556 >>>approxPi(-00S) 3.14408641529861 approxPi 00001) 3.141597653564762Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started