import scipy.stats as staimport mathdef option_call(s,x,r,sigma,t):d1=(math.log(s/x)+(r+sigma**2/2)*t)/(math.sqrt(t)*sigma)d2=d1-sigma*math.sqrt(t)c=s*sta.norm.cdf(d1,0,1)-x*sta.norm.cdf(d2,0,1)*math.exp(-r*t)return c