Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 6 - Functions - Programming Exercises - Page 206: 6.14

Answer

code

Work Step by Step

# 6.14 (Estimate ) can be computed using the following series: # Write a function that returns m(i) for a given i and write a test program that displays # the following table: # i m(i) # 1 4.0000 # 101 3.1515 # 201 3.1466 # 301 3.1449 # 401 3.1441 # 501 3.1436 # 601 3.1433 # 701 3.1430 # 801 3.1428 # 901 3.1427 from CH6Module import MyFunctions def main(): print("i\t\t\t m(i)") for i in range(1, 1001, 100): print(format(i, ".0f"), "\t\t", format(MyFunctions.computePi(i), "-3.4f")) main()
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.