import os
import math

os.chdir('C:\\Users\\Евгений\\Desktop\\python-labs\\TEMA7')

f = lambda x, a, b: math.exp(-(x - a)**2 / b) / math.sqrt(2 * math.pi * b)

a = 1; b = 16
values = []
x = a - 3 * math.sqrt(b)

while x <= a + 3 * math.sqrt(b):
    values.append(f(x,a,b))
    x += 0.2 * math.sqrt(b)
print(values)

fp=open('IKZ.txt','w')
for i in range(0,len(values),2):
    new = str(values[i])+","+str(values[i+1]) + "\n"
    fp.write(new)
fp.close()
