From 5fc96451450004c5230713683d81227004c2f26c Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 20 Apr 2020 22:28:03 +0530 Subject: [PATCH 01/17] Create Untitled4.ipynb --- Untitled4.ipynb | 138 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Untitled4.ipynb diff --git a/Untitled4.ipynb b/Untitled4.ipynb new file mode 100644 index 0000000..f98dc2b --- /dev/null +++ b/Untitled4.ipynb @@ -0,0 +1,138 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n" + ] + } + ], + "source": [ + "a=10\n", + "a\n", + "print(a)\n", + "a\n", + "b=9" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "print(type(a))\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "data": { + "text/plain": [ + "'Hello World'" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "s=\"Hello World\"\n", + "s\n", + "print(type(s))\n", + "s" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hi\n" + ] + } + ], + "source": [ + "if 1>2 : \n", + " print(\"Hello\") \n", + " print(\"Hello\")\n", + " print(\"Hello\") \n", + "elif 1==1 :\n", + " print(\"Hi\")\n", + "else : \n", + " print(\"World\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.7.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 2d3b4aa7884d9114a5f3b104c44f2c0090dc13e3 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 20 Apr 2020 22:28:06 +0530 Subject: [PATCH 02/17] Create Untitled3.ipynb --- Untitled3.ipynb | 251 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 Untitled3.ipynb diff --git a/Untitled3.ipynb b/Untitled3.ipynb new file mode 100644 index 0000000..aa74b4c --- /dev/null +++ b/Untitled3.ipynb @@ -0,0 +1,251 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello World\n" + ] + } + ], + "source": [ + "print(\"Hello World\")" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1+1" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1-1" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.5" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "9/2" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "9//2" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "9%2" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "2**3" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "True" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "False" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1<2" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n", + "\n" + ] + } + ], + "source": [ + "a=10\n", + "b=10.1\n", + "c=int(a+b)\n", + "print(c)\n", + "print(type(c))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.7.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 8f595258a0199e9c2dfab2817886a66bea937f4d Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 20 Apr 2020 22:28:08 +0530 Subject: [PATCH 03/17] Create Untitled2.ipynb --- Untitled2.ipynb | 183 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 Untitled2.ipynb diff --git a/Untitled2.ipynb b/Untitled2.ipynb new file mode 100644 index 0000000..9be32df --- /dev/null +++ b/Untitled2.ipynb @@ -0,0 +1,183 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "i=10\n", + "i" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "a=10" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "\n" + ] + } + ], + "source": [ + "a=-10\n", + "b=10.1\n", + "c=int(a+b) #Typecasting\n", + "print(c)\n", + "print(type(c))" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'aaaaa'" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "str=\"aaaaa\"\n", + "str" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hi\n" + ] + } + ], + "source": [ + "if 1>2 :\n", + " print(\"Hello\")\n", + "elif 1==1:\n", + " print(\"Hi\")\n", + "else:\n", + " print(\"World\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.7.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From afde5f3375bc82093a39688e130fc837b0205145 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 20 Apr 2020 22:28:09 +0530 Subject: [PATCH 04/17] Create Untitled1.ipynb --- Untitled1.ipynb | 395 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 Untitled1.ipynb diff --git a/Untitled1.ipynb b/Untitled1.ipynb new file mode 100644 index 0000000..11e9b45 --- /dev/null +++ b/Untitled1.ipynb @@ -0,0 +1,395 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello world\n" + ] + } + ], + "source": [ + "print(\"Hello world\")" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1+1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1*4" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.0" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "8/2" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "8//2" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "9%2" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4194304" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "2**22" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "45" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "(2+3)*(9+0)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "True" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "False" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1>2" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1<2" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1==1" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "i=10\n", + "i" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "-1000" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a=-1000\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "z=10" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "z" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.7.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 10d47df0920e202d744546a1de57911284fec475 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 20 Apr 2020 22:28:11 +0530 Subject: [PATCH 05/17] Create Untitled.ipynb --- Untitled.ipynb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Untitled.ipynb diff --git a/Untitled.ipynb b/Untitled.ipynb new file mode 100644 index 0000000..f828f07 --- /dev/null +++ b/Untitled.ipynb @@ -0,0 +1,32 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.7.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 4332253bde861e8fb9589065eb32a52acc6a653e Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Mon, 20 Apr 2020 22:28:14 +0530 Subject: [PATCH 06/17] Update Data Type.ipynb --- Data Type.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data Type.ipynb b/Data Type.ipynb index 84d7819..4a0f321 100644 --- a/Data Type.ipynb +++ b/Data Type.ipynb @@ -49,7 +49,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -58,7 +58,7 @@ "0.5" ] }, - "execution_count": 3, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } From a1ef8125aef179e7c49fc60a5d4ad6a9f9d5a1e1 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Sun, 26 Apr 2020 00:52:58 +0530 Subject: [PATCH 07/17] Update Untitled3.ipynb --- Untitled3.ipynb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Untitled3.ipynb b/Untitled3.ipynb index aa74b4c..d2e759c 100644 --- a/Untitled3.ipynb +++ b/Untitled3.ipynb @@ -39,22 +39,19 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n" + ] } ], "source": [ - "1-1" + "print(1-1)" ] }, { From fa06d2d1f6ea3770ba543aca3fada04f60e62e5a Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Sun, 26 Apr 2020 00:53:00 +0530 Subject: [PATCH 08/17] Update String.ipynb --- String.ipynb | 142 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 83 insertions(+), 59 deletions(-) diff --git a/String.ipynb b/String.ipynb index 51689fc..8b7518d 100644 --- a/String.ipynb +++ b/String.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -11,7 +11,7 @@ "'single quotes'" ] }, - "execution_count": 2, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -22,22 +22,22 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'double quotes'" + "\"doubl'''''''''''''''''''''''''''''e quotes\"" ] }, - "execution_count": 3, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "\"double quotes\"" + "\"doubl'''''''''''''''''''''''''''''e quotes\"" ] }, { @@ -62,79 +62,101 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 12, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "H\n" + "ename": "IndexError", + "evalue": "string index out of range", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m\"Hello, World!\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m13\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m: string index out of range" ] } ], "source": [ "a = \"Hello, World!\"\n", - "print(a[0])" + "print(a[13])" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "umyadip\n" + "Soumya\n" ] } ], "source": [ "b =\"Soumyadip\"\n", - "print(b[2:])" + "print(b[0:6])" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "54321\n" + "654\n" ] } ], "source": [ - "b = \"6543210\"\n", - "print(b[-6:-1])" + "b = \"654321\"\n", + "print(b[-6:3])" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "13\n" + "9\n" ] } ], "source": [ - "a = \"Hello, World!\"\n", + "a = \"Dutipriya\"\n", "print(len(a))" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Atreyee\n" + ] + } + ], + "source": [ + "b = \"Atreyee\"\n", + "print(b[-7:7])" + ] + }, + { + "cell_type": "code", + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -146,13 +168,13 @@ } ], "source": [ - "a = \" Hello, World! \"\n", + "a = \" Hello, World! \"\n", "print(a.strip()) #Remove Space" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 45, "metadata": {}, "outputs": [ { @@ -160,13 +182,13 @@ "output_type": "stream", "text": [ "hello, world!\n", - "Hello, World!\n", - "hello, world!\n" + "HelLo, World!\n", + "HelLo, World!\n" ] } ], "source": [ - "a = \"Hello, World!\"\n", + "a = \"HelLo, World!\"\n", "print(a.lower())\n", "print(a)\n", "a=a.lower()\n", @@ -175,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -183,99 +205,101 @@ "output_type": "stream", "text": [ "Jello, World!\n", - "Hello, World!\n" + "Hello, World!\n", + "Jello, World!\n" ] } ], "source": [ "a = \"Hello, World!\"\n", "print(a.replace(\"H\", \"J\"))\n", + "print(a)\n", + "a=a.replace(\"H\", \"J\")\n", "print(a)" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 53, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['Hello', ' World!']\n", - "['Hello', ' World!']\n" + "['He', '', 'do, Wor', 'd!']\n" ] } ], "source": [ - "a = \"Hello, World!\"\n", - "print(a.split(\",\"))\n", - "l=a.split(\",\")\n", - "print(l)" + "a = \"Helldo, World!\"\n", + "print(a.split(\"l\"))" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 54, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "True\n" + "False\n" ] } ], "source": [ "txt = \"The rain in Spain stays mainly in the plain\"\n", - "x = \"ain\" in txt\n", + "x = \"aidegfdhfdgdhdn\" in txt\n", "print(x)" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 112, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "10 Python \n" + "10gfchbfdgnhdfghndfgnfdgndfgn 10 \n" ] } ], "source": [ "a=10\n", "b=\"Python\"\n", - "c=\"{} {} \"\n", - "print(c.format(a,b))" + "c=\"{}gfchbfdgnhdfghndfgnfdgndfgn {} \"\n", + "print(c.format(a,a))\n" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 113, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Python 10 \n" + "10 JAVA 10 JAVA\n" ] } ], "source": [ "a=10\n", "b=\"Python\"\n", - "c=\"{1} {0} \"\n", - "print(c.format(a,b))" + "d=\"JAVA\"\n", + "e=\"C++\"\n", + "c=\"{} {} {} {}\"\n", + "print(c.format(a,d,a,d))\n" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 58, "metadata": {}, "outputs": [ { @@ -287,7 +311,7 @@ } ], "source": [ - "a=10\n", + "\n", "b=\"Python\"\n", "c=\"{p} {q} \"\n", "print(c.format(p=a,q=b))" @@ -295,16 +319,16 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 74, "metadata": {}, "outputs": [], "source": [ - "st = 'hello # my name is # Soumyadip'" + "yt = 'hello # my name is # Soumyadip'" ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -313,13 +337,13 @@ "['hello ', ' my name is ', ' Soumyadip']" ] }, - "execution_count": 24, + "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "st.split('#')" + " tr.split('#')" ] }, { @@ -339,12 +363,12 @@ } ], "source": [ - "st.split('#')[1]" + "tr.split('#')[1]" ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 73, "metadata": {}, "outputs": [ { @@ -353,13 +377,13 @@ "True" ] }, - "execution_count": 27, + "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "'Soumyadip' in st" + "'Soumyadip' in yt" ] } ], From e37b3bb5d54ed6158ec7fde3ce0d4340e82e005a Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Sun, 26 Apr 2020 00:53:03 +0530 Subject: [PATCH 09/17] Update List.ipynb --- List.ipynb | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/List.ipynb b/List.ipynb index b093b36..bc60923 100644 --- a/List.ipynb +++ b/List.ipynb @@ -9,9 +9,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 2, 3]" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "[1,2,3]" ] @@ -24,7 +35,7 @@ { "data": { "text/plain": [ - "['hi', 1, [1, 2]]" + "['hi', 1]" ] }, "execution_count": 2, @@ -33,12 +44,12 @@ } ], "source": [ - "['hi',1,[1,2]]" + "['hi',1]" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -47,7 +58,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -96,22 +107,22 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'b'" + "'a'" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "my_list[1]" + "my_list[0]" ] }, { From 1b2b64fab7578f03db48c6b02b36032d6fa5c780 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Wed, 29 Apr 2020 22:12:20 +0530 Subject: [PATCH 10/17] Update Tuples.ipynb --- Tuples.ipynb | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/Tuples.ipynb b/Tuples.ipynb index 65d8623..c78bf58 100644 --- a/Tuples.ipynb +++ b/Tuples.ipynb @@ -79,7 +79,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -96,7 +96,7 @@ "source": [ "thistuple = (\"apple\", \"banana\", \"cherry\")\n", "print(thistuple[-1])\n", - "print(thistuple[-0])\n", + "print(thistuple[0])\n", "print(thistuple[-2])\n", "print(thistuple[-3])" ] @@ -107,63 +107,64 @@ "metadata": {}, "outputs": [], "source": [ - "thistuple = (\"apple\", \"banana\", \"cherry\")" + "tgyfdfxrdectrs = (\"apple\", \"banana\", \"cherry\")" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "('cherry', 'orange', 'kiwi')\n" + "('banana', 'cherry', 'orange', 'kiwi', 'melon')\n" ] } ], "source": [ "thistuple = (\"apple\", \"banana\", \"cherry\", \"orange\", \"kiwi\", \"melon\", \"mango\")\n", - "print(thistuple[2:5])" + "print(thistuple[1:6])" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "('cherry', 'orange', 'kiwi')\n" + "()\n" ] } ], "source": [ "thistuple = (\"apple\", \"banana\", \"cherry\", \"orange\", \"kiwi\", \"melon\", \"mango\")\n", - "print(thistuple[2:5])" + "print(thistuple[:-7])" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['apple', 'kiwi', 'cherry']\n", - "('apple', 'kiwi', 'cherry')\n" + "['apple', 'kiwi', 'banana', 'cherry']\n", + "('apple', 'kiwi', 'banana', 'cherry')\n" ] } ], "source": [ "x = (\"apple\", \"banana\", \"cherry\")\n", "y = list(x)\n", - "y[1] = \"kiwi\"\n", + "\n", + "y.insert(1,\"kiwi\")\n", "x = tuple(y)\n", "\n", "print(y)\n", @@ -212,12 +213,25 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'thistuple' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mthistuple\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m\"apple\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"banana\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"cherry\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;32mdel\u001b[0m \u001b[0mthistuple\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mthistuple\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mNameError\u001b[0m: name 'thistuple' is not defined" + ] + } + ], "source": [ "thistuple = (\"apple\", \"banana\", \"cherry\")\n", - "del thistuple" + "del thistuple\n", + "print(thistuple)" ] }, { From 1548d9451df6a0c022cea0b67c19fae68b10b74a Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Wed, 29 Apr 2020 22:12:22 +0530 Subject: [PATCH 11/17] Update String.ipynb --- String.ipynb | 175 +++++++++++++++++++++++++++------------------------ 1 file changed, 92 insertions(+), 83 deletions(-) diff --git a/String.ipynb b/String.ipynb index 8b7518d..e42a7e6 100644 --- a/String.ipynb +++ b/String.ipynb @@ -2,18 +2,16 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "'single quotes'" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" + "ename": "SyntaxError", + "evalue": "EOF while scanning triple-quoted string literal (, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m 'single qu''''otes'\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m EOF while scanning triple-quoted string literal\n" + ] } ], "source": [ @@ -22,27 +20,32 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": {}, + "execution_count": 4, + "metadata": { + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } + }, "outputs": [ { "data": { "text/plain": [ - "\"doubl'''''''''''''''''''''''''''''e quotes\"" + "\"double quo''''''''tes\"" ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "\"doubl'''''''''''''''''''''''''''''e quotes\"" + "\"double quo''''''''tes\"" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -51,7 +54,7 @@ "\" wrap lot's of other quotes\"" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -62,24 +65,20 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "metadata": {}, "outputs": [ { - "ename": "IndexError", - "evalue": "string index out of range", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m\"Hello, World!\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m13\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mIndexError\u001b[0m: string index out of range" + "name": "stdout", + "output_type": "stream", + "text": [ + "!dlroW ,olleH\n" ] } ], "source": [ "a = \"Hello, World!\"\n", - "print(a[13])" + "print(a[::-1])" ] }, { @@ -88,123 +87,133 @@ "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "Soumya\n" + "ename": "SyntaxError", + "evalue": "invalid syntax (, line 2)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m2\u001b[0m\n\u001b[1;33m for i in range(len(str)+1:: -1):\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" ] } ], "source": [ - "b =\"Soumyadip\"\n", - "print(b[0:6])" + "str =\"P y t h o n J A V A C++\"\n", + "l=\n" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 11, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "654\n" - ] + "data": { + "text/plain": [ + "'uDivyanshu'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "b = \"654321\"\n", - "print(b[-6:3])" + "a=\"Divyanshu\"\n", + "a=a[8]+a[0:]\n", + "a" ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 25, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "9\n" - ] + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "a = \"Dutipriya\"\n", - "print(len(a))" + "a = \"Dutipr\"\n", + "len(a)" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 28, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Atreyee\n" + "Krishna\n" ] } ], "source": [ - "b = \"Atreyee\"\n", - "print(b[-7:7])" + "b = \"Krishna\"\n", + "print(b[-7:100])" ] }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Hello, World!\n" + "Hello, World!\n" ] } ], "source": [ - "a = \" Hello, World! \"\n", + "a = \" Hello, World! \"\n", "print(a.strip()) #Remove Space" ] }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "hello, world!\n", - "HelLo, World!\n", - "HelLo, World!\n" + "HELLO, World!\n", + "HELLO, WORLD!\n", + "HELLO, World!\n", + "hello, world!\n" ] } ], "source": [ - "a = \"HelLo, World!\"\n", - "print(a.lower())\n", + "a = \"HELLO, World!\"\n", + "print(a)\n", + "print(a.upper())\n", "print(a)\n", "a=a.lower()\n", - "print(a)" + "print(a)\n" ] }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Jello, World!\n", + "HeDhritimano, World!\n", "Hello, World!\n", "Jello, World!\n" ] @@ -212,7 +221,7 @@ ], "source": [ "a = \"Hello, World!\"\n", - "print(a.replace(\"H\", \"J\"))\n", + "print(a.replace(\"ll\", \"Dhritiman\"))\n", "print(a)\n", "a=a.replace(\"H\", \"J\")\n", "print(a)" @@ -220,25 +229,25 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 59, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['He', '', 'do, Wor', 'd!']\n" + "['', 'C']\n" ] } ], "source": [ - "a = \"Helldo, World!\"\n", - "print(a.split(\"l\"))" + "a = \"ABC\"\n", + "print(a.split(\"AB\"))" ] }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -251,50 +260,50 @@ ], "source": [ "txt = \"The rain in Spain stays mainly in the plain\"\n", - "x = \"aidegfdhfdgdhdn\" in txt\n", + "x = \"Speutrwyhejwjq3w4jhjain\" in txt\n", "print(x)" ] }, { "cell_type": "code", - "execution_count": 112, + "execution_count": 71, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "10gfchbfdgnhdfghndfgnfdgndfgn 10 \n" + "Python 10\n" ] } ], "source": [ "a=10\n", "b=\"Python\"\n", - "c=\"{}gfchbfdgnhdfghndfgnfdgndfgn {} \"\n", - "print(c.format(a,a))\n" + "c=\"{} {}\"\n", + "print(c.format(b,a,a,a,a,a,a,a))\n" ] }, { "cell_type": "code", - "execution_count": 113, + "execution_count": 96, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "10 JAVA 10 JAVA\n" + " 333 443 233 133 \n" ] } ], "source": [ - "a=10\n", - "b=\"Python\"\n", - "d=\"JAVA\"\n", - "e=\"C++\"\n", - "c=\"{} {} {} {}\"\n", - "print(c.format(a,d,a,d))\n" + "a=133\n", + "b=\"233\"\n", + "d=\"333\"\n", + "e=\"443\"\n", + "c=\" {1} {0} {3} {2} \"\n", + "print(c.format(a,b,e,d))\n" ] }, { From d32c7d982e9659ee2e47b133eba68a4f4a9abb9a Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Wed, 29 Apr 2020 22:12:25 +0530 Subject: [PATCH 12/17] Update Sets.ipynb --- Sets.ipynb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Sets.ipynb b/Sets.ipynb index cb53a42..ee12881 100644 --- a/Sets.ipynb +++ b/Sets.ipynb @@ -29,48 +29,49 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{1, 2, 3}" + "{1, 2, 3, 12}" ] }, - "execution_count": 2, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "{1,2,3,1,2,1,2,3,3,3,3,2,2,2,1,1,2}" + "{1,2,3,1,2,1,2,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,2,2,1,1,2}" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{'banana', 'orange', 'mango', 'cherry', 'grapes', 'apple'}\n" + "{'apple', 'cherry', 'banana'}\n", + "{'mango', 'grapes', 'banana', 'cherry', 'apple', 'orange'}\n" ] } ], "source": [ "thisset = {\"apple\", \"banana\", \"cherry\"}\n", - "\n", - "thisset.update([\"orange\", \"mango\", \"grapes\"])\n", + "print(thisset)\n", + "thisset.update([ \"grapes\",\"orange\", \"mango\",\"banana\",\"apple\", \"banana\", \"cherry\"])\n", "\n", "print(thisset)" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -82,7 +83,7 @@ } ], "source": [ - "p=(1,2,3,1,2,1,2,3,3,3,3,2,2,2,1,1,1)\n", + "p=[1,2,3,1,2,1,2,3,3,3,3,2,2,2,1,1,1]\n", "s=set(p)\n", "print(s)" ] From b27bf4e121ea3fb9a694ed1eaf86eb28c7850bc1 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Wed, 29 Apr 2020 22:12:28 +0530 Subject: [PATCH 13/17] Update Loops.ipynb --- Loops.ipynb | 155 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 119 insertions(+), 36 deletions(-) diff --git a/Loops.ipynb b/Loops.ipynb index c7879a8..13c828a 100644 --- a/Loops.ipynb +++ b/Loops.ipynb @@ -9,46 +9,42 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ - "seq = [1,2,3,4,5]" + "seq = [1,2]" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1\n", - "2\n", - "3\n", - "4\n", - "5\n" + "1 Hello\n", + "2 Hello\n", + "3 Hello\n" ] } ], "source": [ - "for item in seq:\n", - " print(item)" + "for i in seq:\n", + " print(str(i)+\" Hello\")" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Yep\n", - "Yep\n", "Yep\n", "Yep\n", "Yep\n" @@ -62,52 +58,44 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "2\n", - "4\n", - "6\n", - "8\n", - "10\n" + "1 Hello\n", + "2 Hello\n", + "1 Hello\n", + "2 Hello\n" ] } ], "source": [ "for jelly in seq:\n", - " print(jelly+jelly)" + " for i in seq:\n", + " print(str(i)+\" Hello\")" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "i is: 1\n", - "i is: 1\n", - "i is: 2\n", - "i is: 2\n", - "i is: 3\n", - "i is: 3\n", - "i is: 4\n", - "i is: 4\n" + "i is: --- 4 \n" ] } ], "source": [ - "i = 1\n", + "i = 4\n", "while i < 5:\n", - " print('i is: {}'.format(i))\n", - " print(\"i is: \"+str(i))\n", - " i = i+1" + " print('i is: --- {} '.format(i))\n", + " i=i+1" ] }, { @@ -132,7 +120,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -143,12 +131,107 @@ "1\n", "2\n", "3\n", - "4\n" + "4\n", + "5\n", + "6\n", + "7\n", + "8\n", + "9\n", + "10\n", + "11\n", + "12\n", + "13\n", + "14\n", + "15\n", + "16\n", + "17\n", + "18\n", + "19\n", + "20\n", + "21\n", + "22\n", + "23\n", + "24\n", + "25\n", + "26\n", + "27\n", + "28\n", + "29\n", + "30\n", + "31\n", + "32\n", + "33\n", + "34\n", + "35\n", + "36\n", + "37\n", + "38\n", + "39\n", + "40\n", + "41\n", + "42\n", + "43\n", + "44\n", + "45\n", + "46\n", + "47\n", + "48\n", + "49\n", + "50\n", + "51\n", + "52\n", + "53\n", + "54\n", + "55\n", + "56\n", + "57\n", + "58\n", + "59\n", + "60\n", + "61\n", + "62\n", + "63\n", + "64\n", + "65\n", + "66\n", + "67\n", + "68\n", + "69\n", + "70\n", + "71\n", + "72\n", + "73\n", + "74\n", + "75\n", + "76\n", + "77\n", + "78\n", + "79\n", + "80\n", + "81\n", + "82\n", + "83\n", + "84\n", + "85\n", + "86\n", + "87\n", + "88\n", + "89\n", + "90\n", + "91\n", + "92\n", + "93\n", + "94\n", + "95\n", + "96\n", + "97\n", + "98\n", + "99\n" ] } ], "source": [ - "for i in range(5):\n", + "for i in range(80):\n", " print(i)" ] }, From 209c9ad93c1f535e7227eb05f43c782fe10059c5 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Wed, 29 Apr 2020 22:12:31 +0530 Subject: [PATCH 14/17] Update List.ipynb --- List.ipynb | 226 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 158 insertions(+), 68 deletions(-) diff --git a/List.ipynb b/List.ipynb index bc60923..7015b01 100644 --- a/List.ipynb +++ b/List.ipynb @@ -9,27 +9,25 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "[1, 2, 3]" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 5, 6, 78, 88, 9]\n" + ] } ], "source": [ - "[1,2,3]" + "a=[1,2,3,4,5,5,6,78,88,9]\n", + "print(a)" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -38,7 +36,7 @@ "['hi', 1]" ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -49,11 +47,39 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['a', 'b', 'c', 10]\n", + "['a', 'b', 'c', 10, 'Angshuman']\n", + "['a', 'b', 'c', 10, 'Angshuman', 'aaaaa']\n", + "['a', 'b', 'c', 10, 'Angshuman', 'aaaaa', 'bbb']\n", + "['a', 'b', 'c', 10, 'Angshuman', 'aaaaa', 'bbb', 'uuu']\n", + "['a', 'b', 'c', 10, 'Angshuman', 'aaaaa', 'bbb', 'uuu', 'nnn']\n", + "['a', 'b', 'c', 10, 'Angshuman', 'aaaaa', 'bbb', 'uuu', 'nnn', 'f']\n" + ] + } + ], "source": [ - "my_list = ['a','b','c',10]" + "my_list = ['a','b','c',10]\n", + "print(my_list)\n", + "\n", + "my_list.append(\"Angshuman\")\n", + "print(my_list)\n", + "my_list.append('aaaaa')\n", + "print(my_list)\n", + "my_list.append('bbb')\n", + "print(my_list)\n", + "my_list.append('uuu')\n", + "print(my_list)\n", + "my_list.append('nnn')\n", + "print(my_list)\n", + "my_list.append('f')\n", + "print(my_list)\n" ] }, { @@ -67,107 +93,115 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['a', 'b', 'c', 10, 'd']" + "10" ] }, - "execution_count": 5, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "my_list" + "my_list[3]" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "10" + "[1, 2, 3, 4, 5, 6, 7]" ] }, - "execution_count": 6, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "my_list[3]" + "p=[1,2,3,4,5,6,7]\n", + "p" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 12, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "'a'" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7, 1000]\n" + ] } ], "source": [ - "my_list[0]" + "\n", + "p.append(1000)\n", + "print(p)" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['b', 'c', 10, 'd']" + "['b', 'c', 10, 'Angshuman', 'aaaaa', 'bbb']" ] }, - "execution_count": 8, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "my_list[1:]" + "my_list[1:7]\n", + "\n" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['a']" + "'f'" ] }, - "execution_count": 9, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "my_list[:1]" + "my_list[-1]\n" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -176,16 +210,16 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['NEW', 'b', 'c', 10, 'd']" + "['NEW', 'b', 'c', 10, 'aaaaa', 'bbb', 'uuu', 'nnn', 'fff']" ] }, - "execution_count": 12, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -196,25 +230,53 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 25, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "11\n", + "22\n", + "33\n", + "[44, 55, [66, 77, 88]]\n", + "44\n", + "55\n", + "[66, 77, 88]\n", + "66\n", + "77\n", + "88\n" + ] + } + ], "source": [ - "nest = [1,2,3,[4,5,['target','PYTHON']]]" + "nest = [11,22,33,[44,55,[66,77,88]]]\n", + "\n", + "print(nest[0])\n", + "print(nest[1])\n", + "print(nest[2])\n", + "print(nest[3])\n", + "print(nest[3][0])\n", + "print(nest[3][1])\n", + "print(nest[3][2])\n", + "print(nest[3][2][0])\n", + "print(nest[3][2][1])\n", + "print(nest[3][2][2])" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[4, 5, ['target', 'PYTHON']]" + "[4, 5]" ] }, - "execution_count": 14, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -265,22 +327,27 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['A', 'B', 'C']\n", - "['A', 'C']\n" + "['AAA', 'B', 'C', 'AAA']\n", + "['B', 'C', 'AAA']\n", + "['B', 'C']\n" ] } ], "source": [ - "thislist = [\"A\", \"B\", \"C\"]\n", + "thislist = [\"AAA\", \"B\", \"C\",\"AAA\"]\n", + "print(thislist)\n", + "thislist.remove(\"AAA\")\n", "print(thislist)\n", - "thislist.remove(\"B\")\n", + "\n", + "del thislist[2]\n", + "\n", "print(thislist)" ] }, @@ -305,17 +372,26 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 33, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['apple', 'banana']\n" + ] + } + ], "source": [ "thislist = [\"apple\", \"banana\", \"cherry\"]\n", - "del thislist" + "del thislist[2]\n", + "print(thislist)" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -353,7 +429,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -372,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -416,19 +492,19 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['a', 'b', 'c', 1, 2, 3]\n" + "['a', 'b', 'c', 1, 1, 2, 3]\n" ] } ], "source": [ - "list1 = [\"a\", \"b\" , \"c\"]\n", + "list1 = [\"a\", \"b\" , \"c\",1]\n", "list2 = [1, 2, 3]\n", "\n", "list1.extend(list2)\n", @@ -437,20 +513,34 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 38, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['apple', 'banana']\n" + "apple\n", + "cherry\n", + "Hi\n", + "Hello\n", + "Stack\n", + "banana\n", + "[]\n" ] } ], "source": [ "thislist = [\"apple\", \"banana\", \"cherry\"]\n", - "thislist.pop()\n", + "thislist.append(\"Hello\")\n", + "thislist.pop(0)\n", + "print(thislist.pop(1))\n", + "thislist.append(\"Hi\")\n", + "print(thislist.pop())\n", + "print(thislist.pop())\n", + "thislist.append(\"Stack\")\n", + "print(thislist.pop())\n", + "print(thislist.pop())\n", "print(thislist)" ] } From e5894400f0dbb6f555fa48d8450429a07640b760 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Wed, 29 Apr 2020 22:12:33 +0530 Subject: [PATCH 15/17] Update If-Else.ipynb --- If-Else.ipynb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/If-Else.ipynb b/If-Else.ipynb index 0ff6130..09b4d08 100644 --- a/If-Else.ipynb +++ b/If-Else.ipynb @@ -77,10 +77,7 @@ } ], "source": [ - "if 1 > 2:\n", - " print('first')\n", - "else:\n", - " print('last')" + "p" ] }, { From c6a6e9d1e946961a597e1290bc452ca0498854c4 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Sun, 3 May 2020 21:24:40 +0530 Subject: [PATCH 16/17] Update Loops.ipynb --- Loops.ipynb | 109 +++------------------------------------------------- 1 file changed, 6 insertions(+), 103 deletions(-) diff --git a/Loops.ipynb b/Loops.ipynb index 13c828a..00f1ec1 100644 --- a/Loops.ipynb +++ b/Loops.ipynb @@ -9,7 +9,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -26,8 +26,7 @@ "output_type": "stream", "text": [ "1 Hello\n", - "2 Hello\n", - "3 Hello\n" + "2 Hello\n" ] } ], @@ -120,118 +119,22 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "0\n", "1\n", "2\n", "3\n", - "4\n", - "5\n", - "6\n", - "7\n", - "8\n", - "9\n", - "10\n", - "11\n", - "12\n", - "13\n", - "14\n", - "15\n", - "16\n", - "17\n", - "18\n", - "19\n", - "20\n", - "21\n", - "22\n", - "23\n", - "24\n", - "25\n", - "26\n", - "27\n", - "28\n", - "29\n", - "30\n", - "31\n", - "32\n", - "33\n", - "34\n", - "35\n", - "36\n", - "37\n", - "38\n", - "39\n", - "40\n", - "41\n", - "42\n", - "43\n", - "44\n", - "45\n", - "46\n", - "47\n", - "48\n", - "49\n", - "50\n", - "51\n", - "52\n", - "53\n", - "54\n", - "55\n", - "56\n", - "57\n", - "58\n", - "59\n", - "60\n", - "61\n", - "62\n", - "63\n", - "64\n", - "65\n", - "66\n", - "67\n", - "68\n", - "69\n", - "70\n", - "71\n", - "72\n", - "73\n", - "74\n", - "75\n", - "76\n", - "77\n", - "78\n", - "79\n", - "80\n", - "81\n", - "82\n", - "83\n", - "84\n", - "85\n", - "86\n", - "87\n", - "88\n", - "89\n", - "90\n", - "91\n", - "92\n", - "93\n", - "94\n", - "95\n", - "96\n", - "97\n", - "98\n", - "99\n" + "4\n" ] } ], "source": [ - "for i in range(80):\n", + "for i in range(1,5):\n", " print(i)" ] }, From 5a30eb483f1da25bb6d425ba69219e474fd8d1d3 Mon Sep 17 00:00:00 2001 From: Soumyadip Chowdhury Date: Sun, 3 May 2020 00:27:52 +0530 Subject: [PATCH 17/17] rm --- Untitled.ipynb | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 Untitled.ipynb diff --git a/Untitled.ipynb b/Untitled.ipynb deleted file mode 100644 index f828f07..0000000 --- a/Untitled.ipynb +++ /dev/null @@ -1,32 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "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.7.4" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -}