diff --git a/__pycache__/lab3_task1.cpython-312.pyc b/__pycache__/lab3_task1.cpython-312.pyc new file mode 100644 index 000000000..2aa00527b Binary files /dev/null and b/__pycache__/lab3_task1.cpython-312.pyc differ diff --git a/hello.py b/hello.py new file mode 100644 index 000000000..75d9766db --- /dev/null +++ b/hello.py @@ -0,0 +1 @@ +print('hello world') diff --git a/helo pie b/helo pie new file mode 100644 index 000000000..e69de29bb diff --git a/lab2_extra1.py b/lab2_extra1.py new file mode 100644 index 000000000..2ac76bca2 --- /dev/null +++ b/lab2_extra1.py @@ -0,0 +1,17 @@ +a = int(input()) +b = int(input()) +c = int(input()) + +D = b**2 - 4*a*c +if D > 0: + x1 = b * - 1 + (D** 0.5) / (2 * a) + x2 = b * - 1 - (D ** 0.5) / (2 *a) + print(x1) + print(x2) +elif D == 0: + x1 = -b / 2 * a + print(x1) +elif D < 0: + print('Нет решения') + + diff --git a/lab2_task1.py b/lab2_task1.py new file mode 100644 index 000000000..223dbb6fe --- /dev/null +++ b/lab2_task1.py @@ -0,0 +1,6 @@ +a = int(input()) + +if a % 2 == 1: + print("Нечётное") +else: + print("Чётное") \ No newline at end of file diff --git a/lab2_task2.py b/lab2_task2.py new file mode 100644 index 000000000..c2768599a --- /dev/null +++ b/lab2_task2.py @@ -0,0 +1,7 @@ +a = float(input()) +b = float(input()) +c = int(input()) + +for i in range(c): + print(a) + a = a*b \ No newline at end of file diff --git a/lab2_task3.py b/lab2_task3.py new file mode 100644 index 000000000..677e3666b --- /dev/null +++ b/lab2_task3.py @@ -0,0 +1,6 @@ +a = int(input()) + +if a % 400 == 0 or (a % 4 == 0 and a % 100 != 0): + print(f"{a} - високосный год") +else: + print(f"{a} - невисокосный год") \ No newline at end of file diff --git a/lab2_task4.py b/lab2_task4.py new file mode 100644 index 000000000..5942a55c2 --- /dev/null +++ b/lab2_task4.py @@ -0,0 +1,10 @@ +a = int(input()) +f = 0 +p = 1 + +for i in range(a): + c = f + p + print(c, end=" ") + p = f + f = c +print() \ No newline at end of file diff --git a/lab2_task5.py b/lab2_task5.py new file mode 100644 index 000000000..483dd9408 --- /dev/null +++ b/lab2_task5.py @@ -0,0 +1,12 @@ +a = int(input()) +b = int(input()) + +if b == 0: + print("Делить на 0 нельзя") +elif a % b == 0: + print(f"{a} делится на {b}") + print("Частное = ", a / b) +else: + print(f"{a} не делится на {b}") + print("Остаток = ", a % b) + print("Частное = ", a / b) \ No newline at end of file diff --git a/lab2_task6.py b/lab2_task6.py new file mode 100644 index 000000000..76a778342 --- /dev/null +++ b/lab2_task6.py @@ -0,0 +1,4 @@ +for i in range(1, 10): + for k in range(1, 10): + print(i*k, end=" ") + print() \ No newline at end of file diff --git a/lab3_task1.py b/lab3_task1.py new file mode 100644 index 000000000..fc5813f48 --- /dev/null +++ b/lab3_task1.py @@ -0,0 +1,12 @@ +G = 6,67 * 10**(-11) +c = 3 * 10**8 +earth_mass = 5.974 * 10**24 +sigma_steff_bolc = 5.67 * 10 ** (-8) +g = 9.8 +e = 2.718281828459045 +pi = 3.141592653589793238 +ae = 149.6 * 10**6 +Na = 6.02 * 10**23 +Vm = 22.4 * 10**(-3) +k = 1.38 * 10**(-23) +ht = 1.05 * 10**(-34) \ No newline at end of file diff --git a/lab3_task2.py b/lab3_task2.py new file mode 100644 index 000000000..39b9277f5 --- /dev/null +++ b/lab3_task2.py @@ -0,0 +1,15 @@ +import lab3_task1 as const +import numpy as np + +h = 100 +a = const.pi / 3 +b = const.pi / 6 +v = np.sqrt((const.g * h * np.tan(b)**2)/(2 * np.cos(a)**2 * (1 - np.tan(b) * np.tan(a)))) +print(v) + +T = 200 +E = 300 +from lab3_task1 import k +from lab3_task1 import ht +N = (2 * ht * (const.e**( (-E) / (k * T))) * (E ** ( T/2 ))) / (np.sqrt(const.pi) * (k * T)**(3/2)) +print(N) \ No newline at end of file diff --git a/lab3_task3.py b/lab3_task3.py new file mode 100644 index 000000000..499c31283 --- /dev/null +++ b/lab3_task3.py @@ -0,0 +1,16 @@ +import numpy as np +from lab3_task1 import g + +v0x = int(input("Введите скорость тела: ")) +x0 = int(input("Введите начальные координаты по x: ")) +y0 = int(input("Введите начальные координаты по y: ")) + +mas = [["t", "x", 'y']] + +for t in range(0, 6): + x = x0 + v0x * t + y = y0 + v0x * t - g * t**2 / 2 + mas.append([t, x, y]) + +mas = np.array(mas) +print(mas) diff --git a/lab3_task4.py b/lab3_task4.py new file mode 100644 index 000000000..d041693f9 --- /dev/null +++ b/lab3_task4.py @@ -0,0 +1,15 @@ +import numpy as np + +N = int(input("Ведите значение N: ")) +M = int(input("Ведите значение M: ")) + +trigonometry_array = np.zeros((N, M)) + + +for i in range (0, N ): + for k in range(0, M ): + trigonometry_array[i, k] = np.sin(N * i + M * k + 1) + if trigonometry_array[i, k] < 0: + trigonometry_array[i, k] = 0 + +print(trigonometry_array) diff --git a/lec_breakandcontinue.py b/lec_breakandcontinue.py new file mode 100644 index 000000000..9716771a4 --- /dev/null +++ b/lec_breakandcontinue.py @@ -0,0 +1,9 @@ +for symbol in 'hello world': + if symbol == 'o': + break + print(symbol) + +for symbol in 'hello world': + if symbol == 'o': + continue + print(symbol) \ No newline at end of file diff --git a/lec_data_type.py b/lec_data_type.py new file mode 100644 index 000000000..8432f8f34 --- /dev/null +++ b/lec_data_type.py @@ -0,0 +1,23 @@ +type + +type(3) + +print(type(3)) + +print(type(3.4)) + +print(type('Молодец')) + +a = 'Molodec' +print(type(a)) + +a= ['Molodec', 1, 'Курто', 6, 8] +print(type(a)) + +print(type(True)) + +print(type(False)) + +print(type(None)) + +print(print()) \ No newline at end of file diff --git a/lec_for.py b/lec_for.py new file mode 100644 index 000000000..f109164e0 --- /dev/null +++ b/lec_for.py @@ -0,0 +1,12 @@ +for i in 1, 3, 4: + print(i**2, end=' ') + +for i in 1, 3, 4: + print(i**2, end='\n') + +for i in 1, 3, 4: + print(i, i**2, sep=' - ') + +a = [1, 5, 7, 10] +for i in a: + print(f'{i}**3 = {i**3}') diff --git a/lec_generator_range.py b/lec_generator_range.py new file mode 100644 index 000000000..fb8dc0830 --- /dev/null +++ b/lec_generator_range.py @@ -0,0 +1,14 @@ +a = range(0, 10,2) +print(a) +print(type(a)) +print(a[3]) + +a = 'Good' +for i in range(0, 10, 1) : + if i < len(a) : + print(a[i] + ' - Bad') + else: + print(f'{i}' + ' - Good') + + + \ No newline at end of file diff --git a/lec_input.py b/lec_input.py new file mode 100644 index 000000000..19332dee2 --- /dev/null +++ b/lec_input.py @@ -0,0 +1,9 @@ +a = input() +print(a) + +a = input('Введите значение a: ') +print(a) +print(type(a)) + +a = int('Введите значение a: ') +print(type(a)) \ No newline at end of file diff --git a/lec_list.py b/lec_list.py new file mode 100644 index 000000000..509974ab4 --- /dev/null +++ b/lec_list.py @@ -0,0 +1,17 @@ +a = [1, 3, 6] +print (a[0]) + +b = [8, 10, 11] + +c = a + b +print(c) + +print(c * 2) + +c.append('Good') +print(c) + +a.append(b) +print(a) + +print(len(a)) \ No newline at end of file diff --git a/lec_math_operation.py b/lec_math_operation.py new file mode 100644 index 000000000..1eb149a2a --- /dev/null +++ b/lec_math_operation.py @@ -0,0 +1,13 @@ +print(3+4) + +print(4-3) + +print(3*4) + +print(4**3) + +print(4/3) + +print(4//3) + +print(4%3) \ No newline at end of file diff --git a/lec_obj_and_reference.py b/lec_obj_and_reference.py new file mode 100644 index 000000000..52799bb49 --- /dev/null +++ b/lec_obj_and_reference.py @@ -0,0 +1,7 @@ +s = 3 + 4 + +memory_id = id(s) +print(s, memory_id) + +s = 5 +print(s) \ No newline at end of file diff --git a/lec_print.py b/lec_print.py new file mode 100644 index 000000000..1003b0435 --- /dev/null +++ b/lec_print.py @@ -0,0 +1,11 @@ +print('Fire in the holl') + +print + +print() + +print(3) + +print(3+4) + +print(3, 4) \ No newline at end of file diff --git a/lec_string.py b/lec_string.py new file mode 100644 index 000000000..8f63e9645 --- /dev/null +++ b/lec_string.py @@ -0,0 +1,14 @@ +a = 'Good' +b = 'Bad' + +print(a + b) + +print(a - b) + +print(a * 3) + +c = 50 +d = 10 +print(f'Вставим числа{c} и {d}') + +print (len(a)) diff --git a/lec_while.py b/lec_while.py new file mode 100644 index 000000000..0278547e0 --- /dev/null +++ b/lec_while.py @@ -0,0 +1,4 @@ +i = 5 +while i < 15: + print('i: ', i) + i += 2 \ No newline at end of file diff --git a/task_1.py b/task_1.py new file mode 100644 index 000000000..9e2cccaca --- /dev/null +++ b/task_1.py @@ -0,0 +1,7 @@ +print('Hello, World!') + +print('Маша + Петя = Любовь') + +print('x = 3+4') + +print('x =7') \ No newline at end of file diff --git a/task_2.py b/task_2.py new file mode 100644 index 000000000..dbfe087fe --- /dev/null +++ b/task_2.py @@ -0,0 +1,16 @@ +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 diff --git a/task_3.py b/task_3.py new file mode 100644 index 000000000..fa662f1ec --- /dev/null +++ b/task_3.py @@ -0,0 +1,11 @@ +from math import * + +x = 3 + +y1 = (sqrt(x**3) / (x**3 + 3 / x)) * (4 * x**7 - x**5) + 80 * sqrt(27 * x**4 + 12* x**3 - 5 * x**2 + 10) + +print(y1) + +y2 = (3 % 2 + 16.7 * 4.32 // 1) / (14.5 + 31 % 12 - x**3.4 // 1) + +print(y2) \ No newline at end of file diff --git a/task_4.py b/task_4.py new file mode 100644 index 000000000..8b3256216 --- /dev/null +++ b/task_4.py @@ -0,0 +1,13 @@ +a = [1, 5, 'Good', 'Bad'] + +b = [9, 'Blue', 'Red', 11] + +print(a[1] + b[3]) + +print(a[2] + b[2]) + +print(a[0] * b[0]) + +print(a[1] ** b[3]) + +print(a + b) \ No newline at end of file diff --git a/task_5.py b/task_5.py new file mode 100644 index 000000000..5afd5995f --- /dev/null +++ b/task_5.py @@ -0,0 +1,17 @@ +text = 'Шляпка гриба, покрытая … кожиц..й, держится на … ножк.. . Снизу шляпка затянута … плёнкой. Когда её уберёшь, откроется нижняя … сторона шляпк.. .' + +word1 = input('Введите слово') + +word2 = input('Введите букву') + +word3 = input('Введите слово') + +word4 = input('Введите букву') + +word5 = input('Введите слово') + +word6 = input('Введите слово') + +word7 = input('Введите букву') + +print(f'Шляпка гриба, покрытая {word1} кожиц{word2}й, держится на {word3} ножк{word4} . Снизу шляпка затянута {word5} плёнкой. Когда её уберёшь, откроется нижняя {word6} сторона шляпк{word7} .') \ No newline at end of file diff --git a/task_6.py b/task_6.py new file mode 100644 index 000000000..788300ade --- /dev/null +++ b/task_6.py @@ -0,0 +1,13 @@ +l = [] + +l.append(int(input('Введите возраст'))) + +l.append(input('введите пол')) + +l.append(input('введите имя')) + +l.append(input('Введите город')) + +l.append(int(input('Введите класс'))) + +print(l) \ No newline at end of file