Question: 5 . Bonus Credit Function: Write a Python function called PrimeBonus with one input for the filename to write output data. This function should use

5. Bonus Credit Function: Write a Python function called "PrimeBonus" with one input for the filename to write output data. This function should use the output from the prime function (Problem 3). The function loops through all values of n from 1 to 1000 and calculates the value of \(\mathrm{n}^{\text {th }}\) prime \(-p(n)\). Your function needs to truncate the value of this difference to one decimal place. To the output filename, the function should write the value of n in the first column and the truncated difference or error in the second column. The first line in the output file should have column headings of "\( n \)" and "Error". The bonus credit function will be graded more harshly than the other functions in this homework. If this function does work you will get zero bonus points.
5 . Bonus Credit Function: Write a Python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!