From e555e5cc3fb6933ef7f6e321906331820f8501db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=20=E2=84=96=207=20=D0=B0=D1=83=D0=B4=D0=B8?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D0=96-115?= Date: Fri, 21 Nov 2025 12:16:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=BA=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TEMA7/test.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/TEMA7/test.md b/TEMA7/test.md index 99451f7..50fd47e 100644 --- a/TEMA7/test.md +++ b/TEMA7/test.md @@ -11,29 +11,29 @@ >>> import os >>> os.chdir('C:\\Users\\u115-07\\Desktop\\python-labs\\TEMA7') >>> normal= lambda x, a, b: math.exp(-(x-a)**2/b) / math.sqrt(2 * math.pi * b) - def test_normal(): - a, b = 0, 1 - std_dev = math.sqrt(b) - start = a - 3 * std_dev - end = a + 3 * std_dev - step = 0.2 * std_dev - x_values = [] - current = start - while current <= end: - x_values.append(current) - current += step - function_values = [] - for x in x_values: - y = normal_pdf(x, a, b) - function_values.append(y) - file = open('ikz.txt', 'w') - for i in range(0, len(function_values), 2): - if i + 1 < len(function_values): - file.write(str(function_values[i])+','+str(function_values[i+1])+'\n') - else: - file.write(str(function_values[i])+',0\n') - file.close() - ... + >>> def test_normal(): + ... a, b = 0, 1 + ... std_dev = math.sqrt(b) + ... start = a - 3 * std_dev + ... end = a + 3 * std_dev + ... step = 0.2 * std_dev + ... x_values = [] + ... current = start + ... while current <= end: + ... x_values.append(current) + ... current += step + ... function_values = [] + ... for x in x_values: + ... y = normal_pdf(x, a, b) + ... function_values.append(y) + ... file = open('ikz.txt', 'w') + ... for i in range(0, len(function_values), 2): + ... if i + 1 < len(function_values): + ... file.write(str(function_values[i])+','+str(function_values[i+1])+'\n') + ... else: + ... file.write(str(function_values[i])+',0\n') + ... + ... >>> test_normal() 4.9233388666234e-05,0.0001570512248023814