From 51df32d052543ebdf3f0fe4d9b2f3a50138fc133 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Wed, 11 Feb 2026 22:29:22 +0530 Subject: [PATCH 1/6] 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/6] 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 6c5e2b5c88d2e16b4040f21c3f2313e5ec6ff4da Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Tue, 10 Mar 2026 15:19:36 +0530 Subject: [PATCH 3/6] perform basics of python --- Discount_calc.ipynb | 10 +- function.ipynb | 311 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 312 insertions(+), 9 deletions(-) create mode 100644 function.ipynb diff --git a/Discount_calc.ipynb b/Discount_calc.ipynb index 7d6cfab..d6fde27 100644 --- a/Discount_calc.ipynb +++ b/Discount_calc.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8e61a683", + "id": "346da9f3", "metadata": {}, "outputs": [], "source": [ @@ -32,15 +32,7 @@ "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" } }, diff --git a/function.ipynb b/function.ipynb new file mode 100644 index 0000000..5ced331 --- /dev/null +++ b/function.ipynb @@ -0,0 +1,311 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "id": "cfb7a1e6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You entered: 1\n", + "Hello\n", + "You entered: 2\n", + "welcome\n", + "You entered: 3\n", + "Goodbye\n" + ] + } + ], + "source": [ + "i=''\n", + "while i!='3':\n", + " i=input('Enter any command 1,2,3: ')\n", + " print(f'You entered: {i}')\n", + " if i=='1':\n", + " print('Hello')\n", + " elif i=='2':\n", + " print('welcome')\n", + " else: \n", + " print('Goodbye')" + ] + }, + { + "cell_type": "markdown", + "id": "a1fe8f38", + "metadata": {}, + "source": [ + "write a python program that uses the 'For' loop for \n", + "# iterating through a list of elements and \n", + "# print all the elements present in the screen" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "315520e7", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "2\n", + "3\n", + "4\n", + "5\n", + "6\n" + ] + } + ], + "source": [ + "list=[1,2,3,4,5,6]\n", + "for i in list:\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "386c6a14", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'sub1': 'maths', 'sub2': 'physics', 'sub3': 'biology'}\n", + "print\n", + "print\n" + ] + } + ], + "source": [ + "dict1={\"sub1\":\"maths\",\"sub2\":\"physics\",\"sub3\":\"biology\"}\n", + "for i in dict1:\n", + " if dict1[i]==0:\n", + " print(dict1)\n", + " elif i==1:\n", + " print(dict1[i])\n", + " else :\n", + " print(\"print\")\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "0551a178", + "metadata": {}, + "source": [ + "define list and define variable name search item " + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "104ca2ec", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "2\n", + "3\n", + "4\n", + "5\n", + "6\n" + ] + } + ], + "source": [ + "list1=[1,2,3,4,5,6]\n", + "searchitem=input(\"Enter the item to search: \")\n", + "for i in list1:\n", + " if i== searchitem:\n", + " break\n", + " else:\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "74613992", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "2\n", + "3\n", + "4\n", + "5\n", + "6\n" + ] + } + ], + "source": [ + "list1=[1,2,3,4,5,6]\n", + "searchitem=input(\"Enter the item to search: \")\n", + "for i in list1:\n", + " if i== searchitem:\n", + " continue\n", + " else:\n", + " print(i)" + ] + }, + { + "cell_type": "markdown", + "id": "8c41df9e", + "metadata": {}, + "source": [ + "create a tuple create a list use appendfunction in the list use extend and insert function in the list " + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "c86a1664", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7]\n", + "[1, 8, 2, 3, 4, 5, 6, 7]\n", + "[1, 8, 2, 3, 4, 5, 6, 7, 9, 10]\n" + ] + } + ], + "source": [ + "list_1=[1,2,3,4,5,6]\n", + "list_1.append(7)\n", + "print(list_1)\n", + "\n", + "list_1.insert(1,8)\n", + "print(list_1)\n", + "\n", + "list_1.extend([9,10])\n", + "print(list_1)" + ] + }, + { + "cell_type": "markdown", + "id": "abad4fd5", + "metadata": {}, + "source": [ + "to populate a list with the squares of all the numbers from 1-12" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "5105cfb8", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list_2=[]\n", + "for i in range (1,13):\n", + " list_2.append(i*i)\n", + "\n", + "list_2 \n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "fb13142b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list_sq=[i*i for i in range (1,13)] #listcomprehension\n", + "list_sq" + ] + }, + { + "cell_type": "markdown", + "id": "f0300935", + "metadata": {}, + "source": [ + "#use the sort(),remove(),pop(0) in the list of squares" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "56aa3bc6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 9, 16, 49, 64, 81]" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "list_sq\n", + "list_sq.sort()\n", + "list_sq.remove(4)\n", + "list_sq.pop()\n", + "list_sq\n" + ] + } + ], + "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 ac66a37791c39871ea225e15b42fa216ce98ca5e Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Wed, 11 Mar 2026 14:59:33 +0530 Subject: [PATCH 4/6] try except done --- pyt_sharwari_3rdyr_10march26.ipynb | 98 ++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 pyt_sharwari_3rdyr_10march26.ipynb diff --git a/pyt_sharwari_3rdyr_10march26.ipynb b/pyt_sharwari_3rdyr_10march26.ipynb new file mode 100644 index 0000000..6544d20 --- /dev/null +++ b/pyt_sharwari_3rdyr_10march26.ipynb @@ -0,0 +1,98 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "id": "ae90f889", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter a valid value\n" + ] + } + ], + "source": [ + "i = input(\"Enter value1:\")\n", + "j = input(\"Enter value2:\")\n", + "try:\n", + " value1=int(i)\n", + " value2=int(j)\n", + " v= value1/value2\n", + " print(f\"answer is {v}\")\n", + "except ZeroDivisionError:\n", + " \n", + " print(\"Enter a valid value\") " + ] + }, + { + "cell_type": "markdown", + "id": "cf7e5a20", + "metadata": {}, + "source": [ + "write a program that processors a sequence of numbers entered by the users the program should demonstratethe use of exception handling conditional statement,control statement, iteration ,and sequence data types \n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "eb974cd3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "invalid input\n", + "invalid input\n", + "invalid input\n", + "invalid input\n" + ] + } + ], + "source": [ + "i= input(\"Enter sequence of number: \")\n", + "num = i.split()\n", + "valid_count = 0\n", + "invalid_count = 0\n", + "for j in num:\n", + " try:\n", + " n=int(num)\n", + " valid_count += 1\n", + " print(\"valid input\") \n", + " if n%2==0:\n", + " print(f\"{n} is even number\")\n", + " else:\n", + " print(f\"{n} is odd number\")\n", + "\n", + " except:\n", + " print(\"invalid input\")\n", + " invalid_count +=1 \n", + " " + ] + } + ], + "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 b5e48974ac23e8705deb959ecc52f87ce3cf8a93 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Wed, 11 Mar 2026 15:34:23 +0530 Subject: [PATCH 5/6] try,catch done --- pyt_sharwari_3rdyrCSE_11march26.ipynb | 0 pyt_sharwari_3rdyr_10march26.ipynb | 20 ++++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 pyt_sharwari_3rdyrCSE_11march26.ipynb diff --git a/pyt_sharwari_3rdyrCSE_11march26.ipynb b/pyt_sharwari_3rdyrCSE_11march26.ipynb new file mode 100644 index 0000000..e69de29 diff --git a/pyt_sharwari_3rdyr_10march26.ipynb b/pyt_sharwari_3rdyr_10march26.ipynb index 6544d20..144e481 100644 --- a/pyt_sharwari_3rdyr_10march26.ipynb +++ b/pyt_sharwari_3rdyr_10march26.ipynb @@ -37,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 1, "id": "eb974cd3", "metadata": {}, "outputs": [ @@ -45,10 +45,13 @@ "name": "stdout", "output_type": "stream", "text": [ + "55 is odd number\n", + "56 is even number\n", "invalid input\n", - "invalid input\n", - "invalid input\n", - "invalid input\n" + "89 is odd number\n", + "\n", + "Total valid numbers: 3\n", + "Total invalid inputs: 1\n" ] } ], @@ -59,18 +62,19 @@ "invalid_count = 0\n", "for j in num:\n", " try:\n", - " n=int(num)\n", + " n=int(j)\n", " valid_count += 1\n", - " print(\"valid input\") \n", " if n%2==0:\n", " print(f\"{n} is even number\")\n", " else:\n", " print(f\"{n} is odd number\")\n", "\n", - " except:\n", + " except (TypeError,ValueError):\n", " print(\"invalid input\")\n", " invalid_count +=1 \n", - " " + "\n", + "print(\"\\nTotal valid numbers:\", valid_count)\n", + "print(\"Total invalid inputs:\", invalid_count) " ] } ], From 97e3d3901d34b68f352ae51fd32534e37f34d4e3 Mon Sep 17 00:00:00 2001 From: sharwariudgirwar24 Date: Wed, 11 Mar 2026 15:40:24 +0530 Subject: [PATCH 6/6] concept of basic python done --- pyt_sharwari_3rdyrCSE_11march26.ipynb | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/pyt_sharwari_3rdyrCSE_11march26.ipynb b/pyt_sharwari_3rdyrCSE_11march26.ipynb index e69de29..d397e76 100644 --- a/pyt_sharwari_3rdyrCSE_11march26.ipynb +++ b/pyt_sharwari_3rdyrCSE_11march26.ipynb @@ -0,0 +1,44 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "1bf4ebca", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3, 6, 9, 12, 15, 18, 21, 24, 27, 30]\n" + ] + } + ], + "source": [ + "list_1= [3*i for i in range (1,11)]\n", + "print(list_1)\n" + ] + } + ], + "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 +}