diff --git a/Notebook1.ipynb b/Notebook1.ipynb index 9cfd576..6509e3b 100644 --- a/Notebook1.ipynb +++ b/Notebook1.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "73fb95c9", "metadata": {}, "outputs": [ @@ -10,184 +10,76 @@ "name": "stdout", "output_type": "stream", "text": [ - "7\n" + "110\n" ] } ], "source": [ - "x = 3\n", - "y = 4\n", + "x = int(input(\"Enter a number: \"))\n", + "y = int(input(\"Enter another number: \"))\n", "print(x + y)" ] }, { "cell_type": "code", - "execution_count": null, - "id": "f9658402", + "execution_count": 3, + "id": "ca9af74b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\n" + "[1, 2, 3, 3, 3, 'number', 'number', True]\n", + "{1, 2, 3, 'number'}\n", + "[1, 2, 3, 'number']\n" ] } ], "source": [ - "print(type(y)) # Output: " + "list1 = [1, 2, 3, 3, 3, \"number\", \"number\", True]\n", + "print(list1)\n", + "print(set(list1))\n", + "print(list(set(list1)))" ] }, { "cell_type": "code", - "execution_count": null, - "id": "e759f74e", + "execution_count": 19, + "id": "eb8566c6", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1\n" - ] - } - ], - "source": [ - "list1 = [1, 2, 3, 4, 5]\n", - "print(list1[0])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4590340e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'coconut'" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "list2 = [\"apple\", \"banana\", \"cherry\", \"coconut\", \"grape\"]\n", - "list2[3]" + "import pandas as pd" ] }, { "cell_type": "code", - "execution_count": null, - "id": "7f877009", + "execution_count": 23, + "id": "8001adbc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'It is a collection of items which can be of different data types. It is ordered, \\nchangeable, and allows duplicate values. \\nLists are defined using square brackets [] and items are separated by commas.'" + "Timestamp('2026-02-12 00:00:00')" ] }, - "execution_count": 14, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "#list is also a type of data in Python.\n", - "'''Definition of a List: It is a collection of items which can be of different data types. It is ordered, \n", - "changeable, and allows duplicate values. \n", - "Lists are defined using square brackets [] and items are separated by commas.'''" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e5d50776", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1 is of type \n", - "3.14 is of type \n", - "Hello is of type \n", - "True is of type \n", - "[1, 2, 3] is of type \n", - "{'name': 'Alice', 'age': 30} is of type \n", - "(1, 2) is of type \n", - "{1, 2, 3} is of type \n" - ] - } - ], - "source": [ - "import numpy as np\n", - "all_types = [1, 3.14, \"Hello\", True, [1, 2, 3], {\"name\": \"Alice\", \"age\": 30}, (1, 2), {1, 2, 3}]\n", - "\n", - "#print(type(all_types[-1]))\n", - "#all_types[5][\"name\"]\n", - "\n", - "def tell_list_item_type(lst):\n", - " for item in lst:\n", - " print(f\"{item} is of type {type(item)}\")\n", - "\n", - "tell_list_item_type(all_types)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a061d70d", - "metadata": {}, - "outputs": [], - "source": [ - "list3 = [1, 2, 2, 24, 5, True, 'g']\n", - "new_set = set(list3)\n", - "#print(new_set)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fbac0ecd", - "metadata": {}, - "outputs": [], - "source": [ - "#A set is a collection which is unordered, unchangeable*, and unindexed. In Python, sets are written with curly brackets." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "43c09a96", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1 is of type \n", - "2 is of type \n", - "2 is of type \n", - "24 is of type \n", - "5 is of type \n", - "True is of type \n", - "g is of type \n" - ] - } - ], - "source": [ - "tell_list_item_type(list3)" + "today_date = \"2026-02-12\"\n", + "date=pd.to_datetime(today_date)\n", + "date" ] }, { "cell_type": "code", "execution_count": null, - "id": "4c5c9023", + "id": "f132dab9", "metadata": {}, "outputs": [], "source": [] @@ -195,7 +87,7 @@ ], "metadata": { "kernelspec": { - "display_name": "myenv", + "display_name": "base", "language": "python", "name": "python3" }, @@ -209,7 +101,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.7" + "version": "3.13.9" } }, "nbformat": 4, diff --git a/Notebook2.ipynb b/Notebook2.ipynb new file mode 100644 index 0000000..2343558 --- /dev/null +++ b/Notebook2.ipynb @@ -0,0 +1,59 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 4, + "id": "1b3a412d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Your Amount is Rs. 500\n", + "Your Discount is 5%\n", + "Your Discount Amount is Rs. 25.0\n", + "Your Final Amount is Rs. 475.0\n" + ] + } + ], + "source": [ + "amount = int(input(\"Enter Amount: \"))\n", + "if amount <= 1000:\n", + " discount = 5\n", + "elif amount <= 10000:\n", + " discount = 10\n", + "elif amount >= 20000:\n", + " discount = 15\n", + "else:\n", + " discount = 10\n", + "\n", + "print(f\"Your Amount is Rs. {amount}\")\n", + "print(f\"Your Discount is {discount}%\")\n", + "print(f\"Your Discount Amount is Rs. {amount*(discount/100)}\")\n", + "print(f\"Your Final Amount is Rs. {amount - (amount*(discount/100))}\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "base", + "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.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Pyt_Om_3rdYr_10Mar26.ipynb b/Pyt_Om_3rdYr_10Mar26.ipynb new file mode 100644 index 0000000..955050c --- /dev/null +++ b/Pyt_Om_3rdYr_10Mar26.ipynb @@ -0,0 +1,77 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "3cac4056", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Om Dhage is a minor\n" + ] + } + ], + "source": [ + "user_name = input(\"Enter your name : \")\n", + "try:\n", + " user_age = int(input(\"Enter your age : \"))\n", + " if user_age < 18:\n", + " print(f\"{user_name} is a minor\")\n", + " else:\n", + " print(f\"{user_name} is adult\")\n", + "except ValueError:\n", + " print(\"Enter a valid age. Invalid entry\")" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "ec6abde4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter valid numbers. Invalid entry\n" + ] + } + ], + "source": [ + "num1 = int(input(\"Enter first number : \"))\n", + "num2 = int(input(\"Enter second number : \"))\n", + "result = 0\n", + "\n", + "try:\n", + " result = num1/num2\n", + " print(f\"The result of {num1} divided by {num2} is : {result}\")\n", + "except ZeroDivisionError:\n", + " print(\"Enter valid numbers. Invalid entry\")" + ] + } + ], + "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.14.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Pyt_Om_3rdYr_9Mar26.ipynb b/Pyt_Om_3rdYr_9Mar26.ipynb new file mode 100644 index 0000000..6bb2186 --- /dev/null +++ b/Pyt_Om_3rdYr_9Mar26.ipynb @@ -0,0 +1,225 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "6996a3cf", + "metadata": {}, + "outputs": [ + { + "ename": "", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31mThe kernel failed to start as the Python Environment 'anaconda3 (Python -1.-1.-1)' is no longer available. Consider selecting another kernel or refreshing the list of Python Environments." + ] + } + ], + "source": [ + "print('welcome to DS')" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "88c72525", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You can Marry a girl\n" + ] + } + ], + "source": [ + "def GenderCheck():\n", + " while 1:\n", + " gender = input(\"Enter Your Gender: Male, Female, Other\").lower()\n", + " if gender == \"other\":\n", + " break\n", + " elif gender == \"female\":\n", + " print(\"You can Marry a boy\")\n", + " elif gender == \"male\":\n", + " print(\"You can Marry a girl\")\n", + " else:\n", + " print(\"You are beautiful\")\n", + "\n", + "\n", + "GenderCheck()\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "38143eec", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You can Marry a girl\n", + "You can Marry a boy\n", + "You are beautiful guy\n", + "Your choice\n" + ] + } + ], + "source": [ + "def GenderCheck(gender):\n", + " if gender == \"other\":\n", + " print(\"Your choice\")\n", + " elif gender == \"female\":\n", + " print(\"You can Marry a boy\")\n", + " GenderCheck(input(\"Enter Your Gender: Male, Female, Other\").lower())\n", + " elif gender == \"male\":\n", + " print(\"You can Marry a girl\")\n", + " GenderCheck(input(\"Enter Your Gender: Male, Female, Other\").lower())\n", + " else:\n", + " print(\"You are beautiful guy\")\n", + " GenderCheck(input(\"Enter Your Gender: Male, Female, Other\").lower())\n", + "\n", + "\n", + "GenderCheck(input(\"Enter Your Gender: Male, Female, Other\").lower())\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "640c59a3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Samosa\n", + "Kachori\n", + "Idli\n", + "Dosa\n", + "Chinese\n", + "Biryani\n" + ] + } + ], + "source": [ + "lst = [\"Samosa\", \"Kachori\", \"Idli\", \"Dosa\", \"Chinese\", \"Biryani\"]\n", + "\n", + "for i in lst:\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "fa9204ec", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Iteam1\n", + "Iteam2\n", + "Iteam3\n", + "Iteam1\n", + "Iteam2\n", + "Iteam3\n" + ] + } + ], + "source": [ + "dic = {\"Iteam1\" : \"pen\", \"Iteam2\" : \"Pencil\", \"Iteam3\" : \"Paper\", \"Iteam1\" : \"Bag\"}\n", + "for i in dic:\n", + " print(f\"{i}\")\n", + "for j in dic:\n", + " print(f\"{j}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "75a2c084", + "metadata": {}, + "outputs": [], + "source": [ + "# Search Iteam in list\n", + "\n", + "lst = [\"Samosa\", \"Kachori\", \"Idli\", \"Dosa\", \"Chinese\", \"Biryani\"]\n", + "\n", + "search = input(\"Enter the Iteam you want to search: \").lower()\n", + "\n", + "for i in lst:\n", + " if i.lower() == search:\n", + " print(f\"{search} is present in the list\")\n", + " break\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "0cba8a1d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]\n", + "[1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728]\n" + ] + } + ], + "source": [ + "# Append , extent in list\n", + "\n", + "list = []\n", + "for i in range(1, 13):\n", + " # item = i*i\n", + " list.append(pow(i, 2))\n", + "\n", + "print(list)\n", + "\n", + "list_comprehension = [pow(i, 3) for i in range(1, 13)]\n", + "print(list_comprehension)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "4d34b1ed", + "metadata": {}, + "outputs": [], + "source": [ + "# Use the sort(), remove(), pop() function in list of squares that you have created\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.14.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}