Advertisement
Advertisement
| 08.18.2008 at 03:26PM PDT, ID: 23657938 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: |
from __future__ import division
import math
a=raw_input("What is the value of xmin?")
b=raw_input("What is the value of dx?")
c=raw_input("What is the value of nx?")
xmin=float(a)
dx=float(b)
nx=int(c)
n=int(c)
l=[]
for x in range(0.00,n):
print xmin+x*dx
def line(n):
s=''
i=raw_input("Please choose a scale for your plot")
n=int(i)
for j in range(0.00,n):
s= s+ "*" + "\n"
print s
return s
def gauss(x):
gaussa=math.pi(2)
gaussb=math.sqrt(gaussa)
gaussc=1/gaussb
gaussd=math.exp(-0.5*-2.00**2)
gausse= gaussc*gaussd
return gausse
print gausse
line(gauss)
print line(gauss)
MY OUTPUT WAS
What is the value of xmin?-2.5
What is the value of dx?0.5
What is the value of nx?11
-2.5
-2.0
-1.5
-1.0
-0.5
0.0
0.5
1.0
1.5
2.0
2.5
Please choose a scale for your plot100
*
Please choose a scale for your plot100
*
*
|