#F.py, exer 7.1 from math import exp, sin, pi class F: def __init__(self, a, w): self.a = a self.w = w def value(self,x): return exp(-self.a*x)*sin(self.w*x) #create two instances (objects) of class F f1 = F(1.0,0.1) f2 = F(2.0,0.1) #print the coefficient a from both objects print(f1.a,f2.a) #evaluate and print both for x = pi print(f1.value(pi)) print(f2.value(pi)) """ Terminal > python F.py 1.0 2.0 0.01335383513703555 0.0005770715401197441 """