From c136edd8e54f3bfbbd29cf2e3731fe126eadb946 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Wed, 25 Sep 2024 16:04:53 +0000 Subject: [PATCH 01/12] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D1=81=D0=BB=D1=83?= =?UTF-8?q?=D1=88=D0=B0=D0=BB=20=D0=BF=D0=B5=D1=80=D0=B2=D1=83=D1=8E=20?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D1=8E=20=D0=B8=20=D0=BD=D0=B0?= =?UTF-8?q?=D1=87=D0=B0=D0=BB=20=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=20=D0=BB?= =?UTF-8?q?=D0=B0=D0=B1=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lec_data_type.py | 11 +++++++++++ lec_input.py | 9 +++++++++ lec_list.py | 16 ++++++++++++++++ lec_string.py | 13 +++++++++++++ task_1.py | 5 +++++ task_2.py | 8 ++++++++ 6 files changed, 62 insertions(+) create mode 100644 lec_data_type.py create mode 100644 lec_input.py create mode 100644 lec_list.py create mode 100644 lec_string.py create mode 100644 task_1.py create mode 100644 task_2.py diff --git a/lec_data_type.py b/lec_data_type.py new file mode 100644 index 000000000..4477141ae --- /dev/null +++ b/lec_data_type.py @@ -0,0 +1,11 @@ +a = 'молодец' + +print(a) + +a = ['лох', 1, 'круто!', 5, 98] + +print(type(a)) + +print(type(False)) + +print(type(None)) \ No newline at end of file diff --git a/lec_input.py b/lec_input.py new file mode 100644 index 000000000..de8c4469f --- /dev/null +++ b/lec_input.py @@ -0,0 +1,9 @@ + + +a = input('Введите значение a: ') +print(a) +print(type(a)) + +b = int(input('Введите значене b: ')) +print(b) +print(type(b)) \ No newline at end of file diff --git a/lec_list.py b/lec_list.py new file mode 100644 index 000000000..3767ceef5 --- /dev/null +++ b/lec_list.py @@ -0,0 +1,16 @@ +a = [1, 3, 6] + +print(a[0]) + +b = [8, 10 , 11] + +c = a+b +print(c) + +print(c*2) + +c.append('СашаЛошара') +print(c) + +a.append(b) +print(b) \ No newline at end of file diff --git a/lec_string.py b/lec_string.py new file mode 100644 index 000000000..20e1c906c --- /dev/null +++ b/lec_string.py @@ -0,0 +1,13 @@ +a ='Good' +b ="Bad" + +print(a+b) + +print(a*3) + +c = 50 +p = 40 + +print(f'вставим числа {c} и {p}') + +print(len(a)) diff --git a/task_1.py b/task_1.py new file mode 100644 index 000000000..876431b35 --- /dev/null +++ b/task_1.py @@ -0,0 +1,5 @@ +print("Hello, World!") +print("Маша + Петя = Любовь") +print("x = 3 + 4") +a = 3+4 +print(f"{a} = результат предыдущего примера") diff --git a/task_2.py b/task_2.py new file mode 100644 index 000000000..4c2c6886f --- /dev/null +++ b/task_2.py @@ -0,0 +1,8 @@ +x = 'Hello, World!' +print(type(x)) +x = 3 + 4 +print(type(x)) +x = 3 / 4 +print(type(x)) +x = [1, 2, 5, 10, 100] +print(type(x)) \ No newline at end of file From 1de64033efa2b31082f8ee56137e59ebdf86553e Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Mon, 30 Sep 2024 21:09:31 +0200 Subject: [PATCH 02/12] Delete task_2.py --- task_2.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 task_2.py diff --git a/task_2.py b/task_2.py deleted file mode 100644 index 4c2c6886f..000000000 --- a/task_2.py +++ /dev/null @@ -1,8 +0,0 @@ -x = 'Hello, World!' -print(type(x)) -x = 3 + 4 -print(type(x)) -x = 3 / 4 -print(type(x)) -x = [1, 2, 5, 10, 100] -print(type(x)) \ No newline at end of file From bdcd9473d2d9701008fe8db24b7a6205a31dc08c Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Mon, 30 Sep 2024 21:10:18 +0200 Subject: [PATCH 03/12] Delete lec_data_type.py --- lec_data_type.py | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 lec_data_type.py diff --git a/lec_data_type.py b/lec_data_type.py deleted file mode 100644 index 4477141ae..000000000 --- a/lec_data_type.py +++ /dev/null @@ -1,11 +0,0 @@ -a = 'молодец' - -print(a) - -a = ['лох', 1, 'круто!', 5, 98] - -print(type(a)) - -print(type(False)) - -print(type(None)) \ No newline at end of file From 18e6a7d8e353055ca14f517e46f03e873297ba56 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Mon, 30 Sep 2024 21:10:26 +0200 Subject: [PATCH 04/12] Delete lec_input.py --- lec_input.py | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 lec_input.py diff --git a/lec_input.py b/lec_input.py deleted file mode 100644 index de8c4469f..000000000 --- a/lec_input.py +++ /dev/null @@ -1,9 +0,0 @@ - - -a = input('Введите значение a: ') -print(a) -print(type(a)) - -b = int(input('Введите значене b: ')) -print(b) -print(type(b)) \ No newline at end of file From ec3a9edbace8feb2544ebdc83c4afcaa9e0665da Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Mon, 30 Sep 2024 21:10:42 +0200 Subject: [PATCH 05/12] Delete lec_list.py --- lec_list.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 lec_list.py diff --git a/lec_list.py b/lec_list.py deleted file mode 100644 index 3767ceef5..000000000 --- a/lec_list.py +++ /dev/null @@ -1,16 +0,0 @@ -a = [1, 3, 6] - -print(a[0]) - -b = [8, 10 , 11] - -c = a+b -print(c) - -print(c*2) - -c.append('СашаЛошара') -print(c) - -a.append(b) -print(b) \ No newline at end of file From 6f1a7ea7be19a80d53c36095131a8d87f9e251bd Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Mon, 30 Sep 2024 21:10:56 +0200 Subject: [PATCH 06/12] Delete lec_string.py --- lec_string.py | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 lec_string.py diff --git a/lec_string.py b/lec_string.py deleted file mode 100644 index 20e1c906c..000000000 --- a/lec_string.py +++ /dev/null @@ -1,13 +0,0 @@ -a ='Good' -b ="Bad" - -print(a+b) - -print(a*3) - -c = 50 -p = 40 - -print(f'вставим числа {c} и {p}') - -print(len(a)) From 0821b62540337a9d6bd170eff2319e5cc856f415 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Mon, 30 Sep 2024 21:11:13 +0200 Subject: [PATCH 07/12] Delete task_1.py --- task_1.py | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 task_1.py diff --git a/task_1.py b/task_1.py deleted file mode 100644 index 876431b35..000000000 --- a/task_1.py +++ /dev/null @@ -1,5 +0,0 @@ -print("Hello, World!") -print("Маша + Петя = Любовь") -print("x = 3 + 4") -a = 3+4 -print(f"{a} = результат предыдущего примера") From 1c808db875f888ab357943bb0fb2dc5503c48109 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Wed, 16 Oct 2024 16:49:21 +0000 Subject: [PATCH 08/12] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=B5=20=D0=B7=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lec_3_base_task_1.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lec_3_base_task_1.py diff --git a/lec_3_base_task_1.py b/lec_3_base_task_1.py new file mode 100644 index 000000000..45ec8f7bc --- /dev/null +++ b/lec_3_base_task_1.py @@ -0,0 +1,10 @@ +gravitational_constant = 6,67 * 10 ** -11 +speed_of_light = 3 * 10 ** 8 +avogadro_constant = 6.02214076 * 10 ** 23 +planck_constant = 6.62607015 * 10 ** 34 +first_radiation_constant = 3.741771852 * 10 ** -16 +elementary_charge = 1.602176634 * 10 ** -19 +boltzmann_constant = 1.380649 * 10 ** -23 +electron_mass = 9.1093837139 * 10 ** -31 +conductance_quantum = 7.748091729 * 10 ** -5 +molar_planck_constant = 3.9903127128934314 * 10 ** -10 \ No newline at end of file From ebf3913e94a292517abae7a79741289816337dd6 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Wed, 13 Nov 2024 12:34:03 +0000 Subject: [PATCH 09/12] =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/lec_create_func.cpython-312.pyc | Bin 0 -> 473 bytes lec_3_base_task_1.py => constants.py | 0 lec_args.py | 8 ++++ lec_call_func.py | 9 ++++ lec_create_func.py | 6 +++ lec_data_type.py | 44 ++++++++++++++++++++ lec_scop.py | 12 ++++++ 7 files changed, 79 insertions(+) create mode 100644 __pycache__/lec_create_func.cpython-312.pyc rename lec_3_base_task_1.py => constants.py (100%) create mode 100644 lec_args.py create mode 100644 lec_call_func.py create mode 100644 lec_create_func.py create mode 100644 lec_data_type.py create mode 100644 lec_scop.py diff --git a/__pycache__/lec_create_func.cpython-312.pyc b/__pycache__/lec_create_func.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1aa7f1a3782f5aad8875c7500d37f55ff37fdf50 GIT binary patch literal 473 zcmY*VJxjwt7=GWh#iTYU{(|6^4t8_UB6M?d(9Na9B#PKCF9}+S5XC_ST|1~hKwLVg z_*s8|%ViKsaC34KyLIxtvlTpe@1A>}=iYnnUUfYSG>#W1*Fsu9#AY~f0D9vDTHwF| zEQ5nIV^c9x_D~l#g(^ig@P_2u$pGwPh)ZB93!g%~B$S|);I=3HhSAR#w(4xdYgo4H z6;>?IE!*{gd2XTN+GU%$mhYBVgPJ|nXeL@UsQ7ZnR5~qg_e8P?x~g_qI?6<)?r1KW z?-2+8!lj9j;S2&T@c)847{VD`C|3gpp((-!dGhgd-r@HKe~BZ0$DiYUBi=LOQ~nsA z@CSa)Z}|s>JCW1>^HtVa!YTXGc?i|xekRLEc;46iQ--?2IPem-s13xS0ah3o8 literal 0 HcmV?d00001 diff --git a/lec_3_base_task_1.py b/constants.py similarity index 100% rename from lec_3_base_task_1.py rename to constants.py diff --git a/lec_args.py b/lec_args.py new file mode 100644 index 000000000..ea365ab65 --- /dev/null +++ b/lec_args.py @@ -0,0 +1,8 @@ +def my_func(a, b): + x = 3 * a - b + return x + +tmp = my_func() + +def my_func(a = 1, b = 0): + \ No newline at end of file diff --git a/lec_call_func.py b/lec_call_func.py new file mode 100644 index 000000000..df5d794f1 --- /dev/null +++ b/lec_call_func.py @@ -0,0 +1,9 @@ +from lec_create_func import mult_func +from lec_create_func import print_func +tmp = mult_func(4) +print(tmp) +print(mult_func(10)) +print(mult_func('Good ')) + +print_func('hello') +print_func(mult_func('50')) \ No newline at end of file diff --git a/lec_create_func.py b/lec_create_func.py new file mode 100644 index 000000000..95810a162 --- /dev/null +++ b/lec_create_func.py @@ -0,0 +1,6 @@ +def mult_func(a): + x = a * 3 + return x + +def print_func(a): + print(f'Мой принт с юлэкджеком {a}') \ No newline at end of file diff --git a/lec_data_type.py b/lec_data_type.py new file mode 100644 index 000000000..112e1853c --- /dev/null +++ b/lec_data_type.py @@ -0,0 +1,44 @@ +def changer(a , b): + a = 2 + b[0] = 'Good' + +x = 10 +L = [1, 2] + +changer(x, L) +print(x) +print(L) + +L = [1, 2] +changer(x, L[:]) +# complex +x = 3 +y = 4 + +z = complex(x,y) +print(z) + +w = complex(y, x) +print(z + w) +# str +s = 'hello' +print(s[0]) + +#s[0] = 'p' +#print(s) +#tuple +t = (1,4,9) +print(t) +print(t[0]) +#t[0] = 3 +#list +l = [1,4,9] +print(l) +print(l[0]) +l[0] = 3 +print(l) +# dict +d = {'a1':4, 4:'a1', 'str':'Hello'} +print(d['a1']) +print(d['str']) +d['str'] = 'Good' \ No newline at end of file diff --git a/lec_scop.py b/lec_scop.py new file mode 100644 index 000000000..53b6f5d37 --- /dev/null +++ b/lec_scop.py @@ -0,0 +1,12 @@ +x0 = 10 # глобальная область видимости +def move(t): + x = x0 * t # + return x # локальная область видимости +print(move(10)) +#print(x) +a = 'Good' +def my_func(): + a = 'Bad' + print(a) +my_func() +print(a) \ No newline at end of file From 55b309b2bacf489cdcd773701207b18030191520 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Wed, 13 Nov 2024 14:36:40 +0000 Subject: [PATCH 10/12] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/constants.cpython-312.pyc | Bin 0 -> 572 bytes constants.py | 3 ++- task1.py | 9 +++++++++ task2.py | 7 +++++++ task3.py | 16 ++++++++++++++++ task4.py | 15 +++++++++++++++ task5.py | 0 7 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 __pycache__/constants.cpython-312.pyc create mode 100644 task1.py create mode 100644 task2.py create mode 100644 task3.py create mode 100644 task4.py create mode 100644 task5.py diff --git a/__pycache__/constants.cpython-312.pyc b/__pycache__/constants.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4991ed3a10725170e30547f3567629e4941ea165 GIT binary patch literal 572 zcmZ8eOK1~80G&;;*)-{|@K!<%_;-n^Oltm}CovATAK zt|1A!Vi+4}iBW_(8(AjW9txb+XrZ>? zauM1bVfSC&NHK^L>h}-+mR_H3&mQMn9kJfK9-V$x(5K*5;g2?<17o@&-H*vDv-OV+8hC3da zLpcYk*CyFWc bQgmRZuSeAr15l1?X9vKHGTO4j4H@_s!e7NM literal 0 HcmV?d00001 diff --git a/constants.py b/constants.py index 45ec8f7bc..98b182e30 100644 --- a/constants.py +++ b/constants.py @@ -7,4 +7,5 @@ boltzmann_constant = 1.380649 * 10 ** -23 electron_mass = 9.1093837139 * 10 ** -31 conductance_quantum = 7.748091729 * 10 ** -5 -molar_planck_constant = 3.9903127128934314 * 10 ** -10 \ No newline at end of file +molar_planck_constant = 3.9903127128934314 * 10 ** -10 +g = 9.8 \ No newline at end of file diff --git a/task1.py b/task1.py new file mode 100644 index 000000000..240c4095a --- /dev/null +++ b/task1.py @@ -0,0 +1,9 @@ +def arithmetic_mean(arr): + x = 0 + for i in range(len(arr)): + x += arr[i] + return x / len(arr) + +array = [1, 2, 3, 4, 5] + +print(arithmetic_mean(array)) \ No newline at end of file diff --git a/task2.py b/task2.py new file mode 100644 index 000000000..40f5aadde --- /dev/null +++ b/task2.py @@ -0,0 +1,7 @@ +import numpy as np + +def multiply_elements(arr): + return np.prod(arr) + +array = np.array([1, 2, 3, 4, 5]) +print(multiply_elements(array)) diff --git a/task3.py b/task3.py new file mode 100644 index 000000000..8cae2d769 --- /dev/null +++ b/task3.py @@ -0,0 +1,16 @@ +from constants import g + +def mech_energy(mass, height, speed): + + p_energy = mass * g * height + + k_energy = 0.5 * mass * speed**2 + + energy = p_energy + k_energy + return energy + +mass = int(input('Введите массу: ')) +height = int(input('Введите высоту: ')) +speed = int(input('Введите скорость: ')) + +print(mech_energy(mass, height, speed)) \ No newline at end of file diff --git a/task4.py b/task4.py new file mode 100644 index 000000000..caa3b30f5 --- /dev/null +++ b/task4.py @@ -0,0 +1,15 @@ +import numpy as np + +def values(a, b, N): + + x_values = np.linspace(a, b, N) + + y_values = x_values ** 2 + + return y_values + + +a = int(input('Введите первый промежуток')) +b = int(input('Введите второй промежуток')) +N = int(input('Введите число точек')) +print(values(a, b, N)) \ No newline at end of file diff --git a/task5.py b/task5.py new file mode 100644 index 000000000..e69de29bb From e4ce2ee5edfb58285c4d99781998a96670c8f7f6 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Wed, 20 Nov 2024 10:57:43 +0000 Subject: [PATCH 11/12] =?UTF-8?q?=D0=BD=D0=BF=D0=B0=D0=BF=D1=88=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lec_args.py | 2 +- task5.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lec_args.py b/lec_args.py index ea365ab65..a6a566afb 100644 --- a/lec_args.py +++ b/lec_args.py @@ -4,5 +4,5 @@ def my_func(a, b): tmp = my_func() -def my_func(a = 1, b = 0): + \ No newline at end of file diff --git a/task5.py b/task5.py index e69de29bb..f0a75386c 100644 --- a/task5.py +++ b/task5.py @@ -0,0 +1,25 @@ +import numpy as np + +def calculate_area(shape): + if shape == 'круг': + radius = int(input("Введите радиус круга: ")) + area = np.pi * radius ** 2 + return area + elif shape == 'прямоугольник': + length = int(input("Введите длину прямоугольника: ")) + width = int(input("Введите ширину прямоугольника: ")) + area = length * width + return area + elif shape == 'треугольник': + base = int(input("Введите основание треугольника: ")) + height = int(input("Введите высоту треугольника: ")) + area = 0.5 * base * height + return area + else: + return "Некорректная фигура!" + + +user_shape = input("Введите фигуру (круг, прямоугольник, треугольник): ") +area = calculate_area(user_shape) + +print(f"Площадь {user_shape} составляет: {area}") \ No newline at end of file From fb41f9130e436bf5624e805b8b78e2106738f806 Mon Sep 17 00:00:00 2001 From: Dimaaaaaan Date: Wed, 20 Nov 2024 16:43:17 +0000 Subject: [PATCH 12/12] =?UTF-8?q?=D0=BE=D0=BB=D0=B0=D0=BB=D0=B0=D0=BE?= =?UTF-8?q?=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task4.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/task4.py b/task4.py index caa3b30f5..3d6d92e12 100644 --- a/task4.py +++ b/task4.py @@ -2,11 +2,11 @@ def values(a, b, N): - x_values = np.linspace(a, b, N) + x = np.linspace(a, b, N) - y_values = x_values ** 2 + y = x ** 2 - return y_values + return y a = int(input('Введите первый промежуток'))