[Tutor] Python Homework

2016-05-01 Thread Katie Tuite
I'm trying to do a python homework question and cannot figure out how to
start at all.

This is the question

[image: pasted1]
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] (no subject)

2013-09-27 Thread Katie
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. 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Python Programming Help

2013-09-11 Thread Katie

Hello,


I am a beginner in computer programming. I am studying math, and the math class 
that I will be taking requires knowledge in Python. So, I am in a computer 
science class. Therefore, I do not have an in-depth knowledge of computer 
programming. 


I am currently trying to write a program in Python version 2.7.5 that uses the 
math module to compute sinh(x) = 1/2(e^x - e^(-x)) in three ways for a given 
value of x:
1a) by using the sinh function
1b) by using the exp function
1c) by using the value of e and the exponentiation operator **


2. Print the results and note any differences that appear. 


So, I know that I have to create a NotePad file so that I can import that into 
my command prompt.


In my NotePad file, I have the following...I'm not sure if I am even going 
about doing this problem correctly...



def sinh(x):
return (1/2)*(e^x - e^(-x))
def exp(x):
return e**x



I am stuck, and don't know where to go from here. I would appreciate help 
please. 


Thank you.



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor