In [2]:
from pylab import *
x = linspace(0,2*pi,150)
y = exp(sin(x))
plot(x,y)
show()
In [3]:
for x in range(9):
print(x)
In [4]:
def five_thru_seven(x):
if x<8 and x>4:
return x*2
else:
return x
print(five_thru_seven(8))
In [6]:
print(five_thru_seven(6))
In [13]:
from pylab import *
x = linspace(0,10,100)
y = [five_thru_seven(i) for i in x]
In [15]:
plot(x,y); show()
In [ ]: