[Tutor] (no subject)

Katie xrandomheartzx at aim.com
Fri Sep 27 21:56:59 CEST 2013


Hello,


I am trying to write a program using Python v. 2.7.5 that will compute the area under the curve y=sin(x) between x = 0 and x = pi. Perform this calculation varying the n divisions of the range of x between 1 and 10 inclusive and print the approximate value, the true value, and the percent error (in other words, increase the accuracy by increasing the number of trapezoids). Print all the values to three decimal places. 


I am not sure what the code should look like. I was told that I should only have about 12 lines of code for these calculations to be done. 


I am using Wing IDE. I have very basic knowledge in Python.


I would appreciate help. 


Thank you. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130927/a4ba43e8/attachment.html>


More information about the Tutor mailing list