From f1741acb44d2f11fda92514c64ee6ee68f4bda24 Mon Sep 17 00:00:00 2001 From: KisLab <92327326+pyKis@users.noreply.github.com> Date: Fri, 6 Jun 2025 19:32:57 +0500 Subject: [PATCH 1/3] Homework_01 is over --- homework_01/homework_01.ipynb | 153 ++++++++++++++++++++++++++++++---- 1 file changed, 136 insertions(+), 17 deletions(-) diff --git a/homework_01/homework_01.ipynb b/homework_01/homework_01.ipynb index 48efeea..a17ed5c 100644 --- a/homework_01/homework_01.ipynb +++ b/homework_01/homework_01.ipynb @@ -27,12 +27,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "5a4d665d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('1', '4', '3', '2', '5')\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "num = input(\"Введите пятизначное число: \")\n", + "mirored = num[0],num[3],num[2],num[1],num[4]\n", + "print(mirored)" ] }, { @@ -54,12 +64,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "07154103", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Количество выходных до отпуска: 1\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "days = int(input(\"Введите количество дней до отпуска: \"))\n", + "\n", + "full_weeks = days // 7\n", + "remaining_days = days % 7\n", + "weekends = full_weeks * 2\n", + "\n", + "if remaining_days >= 6:\n", + " weekends += 1 \n", + "if remaining_days >= 7:\n", + " weekends += 1 \n", + "\n", + "print(f\"Количество выходных до отпуска: {weekends}\")" ] }, { @@ -81,12 +110,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "70f3324c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "true\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "length = int(input(\"Введите длину: \"))\n", + "width = int(input(\"Введите ширину: \"))\n", + "size = int(input(\"Введите размер куска: \"))\n", + "\n", + "if size % length == 0 or size % width == 0:\n", + " print(\"true\")\n", + "else:\n", + " print(\"false\")" ] }, { @@ -108,12 +152,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "8686127c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Римская запись: LIV\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "def int_to_roman(num):\n", + " val = [\n", + " (1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD'),\n", + " (100, 'C'), (90, 'XC'), (50, 'L'), (40, 'XL'),\n", + " (10, 'X'), (9, 'IX'), (5, 'V'), (4, 'IV'), (1, 'I')\n", + " ]\n", + " roman_num = []\n", + " for n, r in val:\n", + " while num >= n:\n", + " roman_num.append(r)\n", + " num -= n\n", + " return ''.join(roman_num)\n", + "\n", + "number = int(input(\"Введите целое положительное число: \"))\n", + "if number < 1:\n", + " print(\"Число должно быть положительным!\")\n", + "else:\n", + " print(f\"Римская запись: {int_to_roman(number)}\")" ] }, { @@ -136,24 +205,74 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "74e39179", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Да, это вещественное число\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "s = input(\"Введите число: \")\n", + "\n", + "is_valid = True\n", + "dot_count = 0\n", + "sign_count = 0\n", + "\n", + "if not s: \n", + " is_valid = False\n", + "else:\n", + " for i, char in enumerate(s):\n", + " if char == '.':\n", + " dot_count += 1\n", + " if dot_count > 1:\n", + " is_valid = False\n", + " break\n", + " elif char in '+-':\n", + " sign_count += 1\n", + " if i != 0 or sign_count > 1: \n", + " is_valid = False\n", + " break\n", + " elif not char.isdigit():\n", + " is_valid = False\n", + " break\n", + "\n", + " if is_valid:\n", + " if dot_count == 1 and len(s) == 1: \n", + " is_valid = False\n", + " elif sign_count == 1 and len(s) == 1: \n", + " is_valid = False\n", + " elif s[0] in '+-.' and len(s) == 2 and not s[1].isdigit(): \n", + " is_valid = False\n", + " elif s[-1] == '.' and len(s) > 1 and not s[-2].isdigit(): \n", + " is_valid = False\n", + "\n", + "print(\"Да, это вещественное число\" if is_valid else \"Нет, это не вещественное число\")" ] } ], "metadata": { "kernelspec": { - "display_name": ".venv (3.11.12)", + "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", "name": "python", - "version": "3.11.12" + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.0" } }, "nbformat": 4, From 87d3599981da080b251e32a2e0bd6aa0b0a15b83 Mon Sep 17 00:00:00 2001 From: KisLab <92327326+pyKis@users.noreply.github.com> Date: Fri, 6 Jun 2025 19:36:12 +0500 Subject: [PATCH 2/3] fix --- homework_01/homework_01.ipynb | 153 ++++------------------------------ 1 file changed, 17 insertions(+), 136 deletions(-) diff --git a/homework_01/homework_01.ipynb b/homework_01/homework_01.ipynb index a17ed5c..48efeea 100644 --- a/homework_01/homework_01.ipynb +++ b/homework_01/homework_01.ipynb @@ -27,22 +27,12 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "5a4d665d", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('1', '4', '3', '2', '5')\n" - ] - } - ], + "outputs": [], "source": [ - "num = input(\"Введите пятизначное число: \")\n", - "mirored = num[0],num[3],num[2],num[1],num[4]\n", - "print(mirored)" + "# ВАШ КОД ЗДЕСЬ" ] }, { @@ -64,31 +54,12 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "07154103", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Количество выходных до отпуска: 1\n" - ] - } - ], + "outputs": [], "source": [ - "days = int(input(\"Введите количество дней до отпуска: \"))\n", - "\n", - "full_weeks = days // 7\n", - "remaining_days = days % 7\n", - "weekends = full_weeks * 2\n", - "\n", - "if remaining_days >= 6:\n", - " weekends += 1 \n", - "if remaining_days >= 7:\n", - " weekends += 1 \n", - "\n", - "print(f\"Количество выходных до отпуска: {weekends}\")" + "# ВАШ КОД ЗДЕСЬ" ] }, { @@ -110,27 +81,12 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "70f3324c", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "true\n" - ] - } - ], + "outputs": [], "source": [ - "length = int(input(\"Введите длину: \"))\n", - "width = int(input(\"Введите ширину: \"))\n", - "size = int(input(\"Введите размер куска: \"))\n", - "\n", - "if size % length == 0 or size % width == 0:\n", - " print(\"true\")\n", - "else:\n", - " print(\"false\")" + "# ВАШ КОД ЗДЕСЬ" ] }, { @@ -152,37 +108,12 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "8686127c", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Римская запись: LIV\n" - ] - } - ], + "outputs": [], "source": [ - "def int_to_roman(num):\n", - " val = [\n", - " (1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD'),\n", - " (100, 'C'), (90, 'XC'), (50, 'L'), (40, 'XL'),\n", - " (10, 'X'), (9, 'IX'), (5, 'V'), (4, 'IV'), (1, 'I')\n", - " ]\n", - " roman_num = []\n", - " for n, r in val:\n", - " while num >= n:\n", - " roman_num.append(r)\n", - " num -= n\n", - " return ''.join(roman_num)\n", - "\n", - "number = int(input(\"Введите целое положительное число: \"))\n", - "if number < 1:\n", - " print(\"Число должно быть положительным!\")\n", - "else:\n", - " print(f\"Римская запись: {int_to_roman(number)}\")" + "# ВАШ КОД ЗДЕСЬ" ] }, { @@ -205,74 +136,24 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "74e39179", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Да, это вещественное число\n" - ] - } - ], + "outputs": [], "source": [ - "s = input(\"Введите число: \")\n", - "\n", - "is_valid = True\n", - "dot_count = 0\n", - "sign_count = 0\n", - "\n", - "if not s: \n", - " is_valid = False\n", - "else:\n", - " for i, char in enumerate(s):\n", - " if char == '.':\n", - " dot_count += 1\n", - " if dot_count > 1:\n", - " is_valid = False\n", - " break\n", - " elif char in '+-':\n", - " sign_count += 1\n", - " if i != 0 or sign_count > 1: \n", - " is_valid = False\n", - " break\n", - " elif not char.isdigit():\n", - " is_valid = False\n", - " break\n", - "\n", - " if is_valid:\n", - " if dot_count == 1 and len(s) == 1: \n", - " is_valid = False\n", - " elif sign_count == 1 and len(s) == 1: \n", - " is_valid = False\n", - " elif s[0] in '+-.' and len(s) == 2 and not s[1].isdigit(): \n", - " is_valid = False\n", - " elif s[-1] == '.' and len(s) > 1 and not s[-2].isdigit(): \n", - " is_valid = False\n", - "\n", - "print(\"Да, это вещественное число\" if is_valid else \"Нет, это не вещественное число\")" + "# ВАШ КОД ЗДЕСЬ" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": ".venv (3.11.12)", "language": "python", "name": "python3" }, "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.13.0" + "version": "3.11.12" } }, "nbformat": 4, From 922eb54761a8e84459cbc780662de8cd5a28c758 Mon Sep 17 00:00:00 2001 From: KisLab <92327326+pyKis@users.noreply.github.com> Date: Fri, 6 Jun 2025 19:38:32 +0500 Subject: [PATCH 3/3] Homework_01 is over --- homework_01/homework_01.ipynb | 153 ++++++++++++++++++++++++++++++---- 1 file changed, 136 insertions(+), 17 deletions(-) diff --git a/homework_01/homework_01.ipynb b/homework_01/homework_01.ipynb index 48efeea..a17ed5c 100644 --- a/homework_01/homework_01.ipynb +++ b/homework_01/homework_01.ipynb @@ -27,12 +27,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "5a4d665d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('1', '4', '3', '2', '5')\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "num = input(\"Введите пятизначное число: \")\n", + "mirored = num[0],num[3],num[2],num[1],num[4]\n", + "print(mirored)" ] }, { @@ -54,12 +64,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "07154103", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Количество выходных до отпуска: 1\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "days = int(input(\"Введите количество дней до отпуска: \"))\n", + "\n", + "full_weeks = days // 7\n", + "remaining_days = days % 7\n", + "weekends = full_weeks * 2\n", + "\n", + "if remaining_days >= 6:\n", + " weekends += 1 \n", + "if remaining_days >= 7:\n", + " weekends += 1 \n", + "\n", + "print(f\"Количество выходных до отпуска: {weekends}\")" ] }, { @@ -81,12 +110,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "70f3324c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "true\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "length = int(input(\"Введите длину: \"))\n", + "width = int(input(\"Введите ширину: \"))\n", + "size = int(input(\"Введите размер куска: \"))\n", + "\n", + "if size % length == 0 or size % width == 0:\n", + " print(\"true\")\n", + "else:\n", + " print(\"false\")" ] }, { @@ -108,12 +152,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "8686127c", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Римская запись: LIV\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "def int_to_roman(num):\n", + " val = [\n", + " (1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD'),\n", + " (100, 'C'), (90, 'XC'), (50, 'L'), (40, 'XL'),\n", + " (10, 'X'), (9, 'IX'), (5, 'V'), (4, 'IV'), (1, 'I')\n", + " ]\n", + " roman_num = []\n", + " for n, r in val:\n", + " while num >= n:\n", + " roman_num.append(r)\n", + " num -= n\n", + " return ''.join(roman_num)\n", + "\n", + "number = int(input(\"Введите целое положительное число: \"))\n", + "if number < 1:\n", + " print(\"Число должно быть положительным!\")\n", + "else:\n", + " print(f\"Римская запись: {int_to_roman(number)}\")" ] }, { @@ -136,24 +205,74 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "74e39179", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Да, это вещественное число\n" + ] + } + ], "source": [ - "# ВАШ КОД ЗДЕСЬ" + "s = input(\"Введите число: \")\n", + "\n", + "is_valid = True\n", + "dot_count = 0\n", + "sign_count = 0\n", + "\n", + "if not s: \n", + " is_valid = False\n", + "else:\n", + " for i, char in enumerate(s):\n", + " if char == '.':\n", + " dot_count += 1\n", + " if dot_count > 1:\n", + " is_valid = False\n", + " break\n", + " elif char in '+-':\n", + " sign_count += 1\n", + " if i != 0 or sign_count > 1: \n", + " is_valid = False\n", + " break\n", + " elif not char.isdigit():\n", + " is_valid = False\n", + " break\n", + "\n", + " if is_valid:\n", + " if dot_count == 1 and len(s) == 1: \n", + " is_valid = False\n", + " elif sign_count == 1 and len(s) == 1: \n", + " is_valid = False\n", + " elif s[0] in '+-.' and len(s) == 2 and not s[1].isdigit(): \n", + " is_valid = False\n", + " elif s[-1] == '.' and len(s) > 1 and not s[-2].isdigit(): \n", + " is_valid = False\n", + "\n", + "print(\"Да, это вещественное число\" if is_valid else \"Нет, это не вещественное число\")" ] } ], "metadata": { "kernelspec": { - "display_name": ".venv (3.11.12)", + "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", "name": "python", - "version": "3.11.12" + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.0" } }, "nbformat": 4,