From 51df32d052543ebdf3f0fe4d9b2f3a50138fc133 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Wed, 11 Feb 2026 22:29:22 +0530 Subject: [PATCH 1/4] added variables in notebook1 --- .gitignore | 4 +++- Notebook1.ipynb | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 95ac68d..15f962b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Virtual environments -myenv/ +pyt101/ venv/ .env/ @@ -23,3 +23,5 @@ Thumbs.db # Secrets .env + + diff --git a/Notebook1.ipynb b/Notebook1.ipynb index f080647..ca04591 100644 --- a/Notebook1.ipynb +++ b/Notebook1.ipynb @@ -10,28 +10,51 @@ "name": "stdout", "output_type": "stream", "text": [ - "7\n" + "6\n" ] } ], "source": [ "x = 3\n", - "y = 4\n", + "y = 3\n", "print(x + y)" ] }, { "cell_type": "code", - "execution_count": null, - "id": "ca9af74b", + "execution_count": 2, + "id": "20b4d1be", "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Python\n", + "95\n", + "77.5\n", + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n", + "{'name': 'Sharwari', 'age': 22, 'city': 'Nagpur', 'Height': 5.5}\n" + ] + } + ], + "source": [ + "subject = \"Python\"\n", + "marks = 95\n", + "percentage = 77.5\n", + "list1 = [1, 2, 3, 4, 5,6,7,8,9,10]\n", + "dict1 = {\"name\": \"Sharwari\", \"age\": 22, \"city\": \"Nagpur\", \"Height\": 5.5}\n", + "print(subject)\n", + "print(marks)\n", + "print(percentage)\n", + "print(list1)\n", + "print(dict1)" + ] } ], "metadata": { "kernelspec": { - "display_name": "myenv", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -45,7 +68,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.7" + "version": "3.11.9" } }, "nbformat": 4, From 549411ded9e5b4c033cac7a9be78b407e1b2e352 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Thu, 12 Feb 2026 17:02:20 +0530 Subject: [PATCH 2/4] discount calculated successfully using if-elif-else --- Discount_calc.ipynb | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Discount_calc.ipynb diff --git a/Discount_calc.ipynb b/Discount_calc.ipynb new file mode 100644 index 0000000..7d6cfab --- /dev/null +++ b/Discount_calc.ipynb @@ -0,0 +1,49 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "8e61a683", + "metadata": {}, + "outputs": [], + "source": [ + "input_str =float(input(\"Enter a amount: \")) \n", + "if input_str > 5000: \n", + " discount = 0.15 * float(input_str)\n", + " amt = float(input_str) - discount\n", + " print(f\"You got 15% discount! Your discount amount is:{discount}\")\n", + "elif input_str > 1000: \n", + " discount = 0.1 * float(input_str)\n", + " print(f\"You got 10% discount! Your discount amount is:{discount}\")\n", + "elif input_str > 500: \n", + " discount = 0.06 * float(input_str)\n", + " print(f\"You got 6% discount! Your discount amount is:{discount}\")\n", + "else:\n", + " print(\"You are not eligible for any discount.\")\n", + "\n", + "print(f\"Your final amount is: {amt}\")" + ] + } + ], + "metadata": { + "kernelspec": { + "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", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From b60ae8743b6a68e48dd738039baef68746aa3d93 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Thu, 12 Feb 2026 17:08:14 +0530 Subject: [PATCH 3/4] discount calculator made successfully using if-elif-else --- Discount_calc.ipynb | 49 --------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/Discount_calc.ipynb b/Discount_calc.ipynb index 7d6cfab..e69de29 100644 --- a/Discount_calc.ipynb +++ b/Discount_calc.ipynb @@ -1,49 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "8e61a683", - "metadata": {}, - "outputs": [], - "source": [ - "input_str =float(input(\"Enter a amount: \")) \n", - "if input_str > 5000: \n", - " discount = 0.15 * float(input_str)\n", - " amt = float(input_str) - discount\n", - " print(f\"You got 15% discount! Your discount amount is:{discount}\")\n", - "elif input_str > 1000: \n", - " discount = 0.1 * float(input_str)\n", - " print(f\"You got 10% discount! Your discount amount is:{discount}\")\n", - "elif input_str > 500: \n", - " discount = 0.06 * float(input_str)\n", - " print(f\"You got 6% discount! Your discount amount is:{discount}\")\n", - "else:\n", - " print(\"You are not eligible for any discount.\")\n", - "\n", - "print(f\"Your final amount is: {amt}\")" - ] - } - ], - "metadata": { - "kernelspec": { - "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", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.9" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From 3634e8c0d72a6958ddcbfe7d290a20af4a5ecc98 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Thu, 12 Feb 2026 19:08:14 +0530 Subject: [PATCH 4/4] resolved --- Notebook1.ipynb | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/Notebook1.ipynb b/Notebook1.ipynb index ca04591..ded16ad 100644 --- a/Notebook1.ipynb +++ b/Notebook1.ipynb @@ -50,6 +50,69 @@ "print(list1)\n", "print(dict1)" ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "e4fd482d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{11, 12, 13, 14, 15, 'b', 'a', 'c'}\n", + "[11, 12, 13, 14, 15, 14, 11, 'a', 'b', 'c', 'a']\n", + "10.0\n", + "10\n", + "10\n", + "True\n" + ] + } + ], + "source": [ + "list2 = [11, 12, 13, 14, 15 ,14, 11,\"a\", \"b\", \"c\", \"a\"] \n", + "print(set(list2))\n", + "print(list(tuple(list2)))\n", + "price_str = \"10\"\n", + "price_float = float(price_str)\n", + "print(price_float)\n", + "price_int = int(price_float)\n", + "print(price_int)\n", + "price_int = int(price_str)\n", + "print(price_int)\n", + "print(bool(price_str))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ecdad8a4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You got 20% discount! Your discount amount is:800.0\n", + "Your final amount is: 3200.0\n" + ] + } + ], + "source": [ + "input_str =float(input(\"Enter a amount: \")) \n", + "if input_str > 1200: \n", + " discount = 0.2 * float(input_str)\n", + " amt = float(input_str) - discount\n", + " print(f\"You got 20% discount! Your discount amount is:{discount}\")\n", + " print(f\"Your final amount is: {amt}\")\n", + "elif input_str > 800: \n", + " discount = 0.1 * float(input_str)\n", + " print(f\"You got 10% discount! Your discount amount is:{discount}\")\n", + " print(f\"Your final amount is: {amt}\")\n", + "else:\n", + " print(\"You are not eligible for any discount.\")" + ] } ], "metadata": {