diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..2b091f3 Binary files /dev/null and b/.DS_Store differ diff --git a/Python/ConditionalOperators_English.ipynb b/Python/ConditionalOperators_English.ipynb new file mode 100644 index 0000000..b9e9b42 --- /dev/null +++ b/Python/ConditionalOperators_English.ipynb @@ -0,0 +1,122 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "ConditionalOperators_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyPFs3JKzT0pGBftguKEQE4j", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "8B6Yl6gvbYyb" + }, + "outputs": [], + "source": [ + "# Conditions Operator" + ] + }, + { + "cell_type": "code", + "source": [ + "# if-else operator\n", + "\n", + "age = int(input(\"Enter your age: \"))\n", + "\n", + "if age >= 18 :\n", + " print(\"Adult\")\n", + "\n", + "if age < 18 :\n", + " print(\"Child\")\n", + "\n", + "if(age < 18) :\n", + " print(\"Child\")\n", + "else :\n", + " print(\"Adult\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-q4HrTmab6PH", + "outputId": "9db3e93d-19ef-44c6-d262-136fb8e12ced" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Enter your age: 12\n", + "Child\n", + "Child\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "age = int(input(\"Enter your age: \"))\n", + "\n", + "if age >= 60 :\n", + " print(\"Senior\")\n", + "elif age < 60 and age >= 18 :\n", + " print(\"Adult\")\n", + "else :\n", + " print(\"Child\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zANmJwIjexOD", + "outputId": "251632ff-629f-4795-d814-33855f8b86d5" + }, + "execution_count": 12, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Enter your age: 45\n", + "Adult\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "_P2ho04phKIv" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Dictionary_English.ipynb b/Python/Dictionary_English.ipynb new file mode 100644 index 0000000..dc7d1dd --- /dev/null +++ b/Python/Dictionary_English.ipynb @@ -0,0 +1,426 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Dictionary_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyMSdeqnQa7cEHJRi35MGNt1", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "8yl20PP0hYyg" + }, + "outputs": [], + "source": [ + "my_dict = {\n", + " \"Name\" : \"Pepper\",\n", + " \"Age\" : 4,\n", + " \"Gender\" : \"Male\",\n", + "}" + ] + }, + { + "cell_type": "code", + "source": [ + "print(my_dict)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "olXYPtfCh9jr", + "outputId": "b88c4e16-0c8d-4e9e-8c27-1f80f75f9ec5" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{'Name': 'Pepper', 'Age': 4, 'Gender': 'Male'}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "my_dict[\"Height\"] = 5.5" + ], + "metadata": { + "id": "5phEWtJCiCph" + }, + "execution_count": 3, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(my_dict)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "KfHSCLkQiFKM", + "outputId": "f7cd801e-31b7-4a61-959a-8598171b7e3d" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{'Name': 'Pepper', 'Age': 4, 'Gender': 'Male', 'Height': 5.5}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(my_dict[\"Name\"])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "bnmPCKjviG0v", + "outputId": "de092d4c-0f6e-4391-fdb9-8485177447af" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Pepper\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "my_dict[\"Name\"] = \"Pepcoding\"" + ], + "metadata": { + "id": "QU5uSQSPiKDa" + }, + "execution_count": 6, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "my_dict.pop(\"Height\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "DcViRKVuiU9F", + "outputId": "792e58d7-02e9-4392-b91c-387f70f4fcd4" + }, + "execution_count": 7, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "5.5" + ] + }, + "metadata": {}, + "execution_count": 7 + } + ] + }, + { + "cell_type": "code", + "source": [ + "my_dict.pop(\"Height\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "wcFWBjFaiWW7", + "outputId": "eb28da36-16db-4408-cc4f-9aff0f4ec37f" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "error", + "ename": "KeyError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmy_dict\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Height\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mKeyError\u001b[0m: 'Height'" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "my_dict" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "svSLB5vSiYUs", + "outputId": "155d8e3e-8be6-4fb6-987b-60296237209c" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'Age': 4, 'Gender': 'Male', 'Name': 'Pepcoding'}" + ] + }, + "metadata": {}, + "execution_count": 9 + } + ] + }, + { + "cell_type": "code", + "source": [ + "for key in my_dict.keys():\n", + " print(key)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Y0ii32zSiZdC", + "outputId": "5a945bad-175a-4dc5-8c50-1211250f5b86" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Name\n", + "Age\n", + "Gender\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "for value in my_dict.values():\n", + " print(value)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Jjtfgs-oifpt", + "outputId": "730ff102-2278-4db8-eda8-ef5a98a3069b" + }, + "execution_count": 11, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Pepcoding\n", + "4\n", + "Male\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "dict2 = my_dict.copy()" + ], + "metadata": { + "id": "lFKpVGZkijBa" + }, + "execution_count": 12, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "del my_dict" + ], + "metadata": { + "id": "DNPM4KZcimk6" + }, + "execution_count": 13, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "my_dict" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "p_tiO0MwitAH", + "outputId": "31ce5422-0b53-4d50-fd00-733937757f3a" + }, + "execution_count": 14, + "outputs": [ + { + "output_type": "error", + "ename": "NameError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmy_dict\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mNameError\u001b[0m: name 'my_dict' is not defined" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(dict2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "b3Uy0VR_it_R", + "outputId": "449d46bd-8624-49b9-9f92-5a7b4f7a0190" + }, + "execution_count": 15, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{'Name': 'Pepcoding', 'Age': 4, 'Gender': 'Male'}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "dict3 = {\n", + " \"test\": dict2\n", + "}" + ], + "metadata": { + "id": "Ja8ug5eXivET" + }, + "execution_count": 17, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(dict3)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "F6Nnvtq8ixt8", + "outputId": "5315eb34-5248-4c8e-9044-81a6a0ff5918" + }, + "execution_count": 18, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{'test': {'Name': 'Pepcoding', 'Age': 4, 'Gender': 'Male'}}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "dict3[\"new\"] = (1,2,3)" + ], + "metadata": { + "id": "hI65-dutjC57" + }, + "execution_count": 19, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "dict3.pop(\"test\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "X6-GcP8RjEz1", + "outputId": "f48e6c8e-2a94-4ece-cb9c-c4e14305bf77" + }, + "execution_count": 20, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{'Age': 4, 'Gender': 'Male', 'Name': 'Pepcoding'}" + ] + }, + "metadata": {}, + "execution_count": 20 + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "tzYxJHlUjG3R" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Functions.ipynb b/Python/Functions.ipynb new file mode 100644 index 0000000..9628227 --- /dev/null +++ b/Python/Functions.ipynb @@ -0,0 +1,79 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Functions.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyP7eO/fWZhb9DhZ/EMknfS7", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Angz0noYPexM", + "outputId": "d9cb0b39-0d32-4e46-f0ef-115ed195d0d3" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "5\n", + "4\n", + "3\n", + "2\n", + "1\n", + "0\n" + ] + } + ], + "source": [ + "# print dec 5 - 0\n", + "\n", + "def pd(n) : \n", + " if n < 0 :\n", + " return\n", + " \n", + " print(n)\n", + " pd(n - 1)\n", + "\n", + "pd(5)" + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "QPPdwXV1Pw0M" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Functions_Advanced_English.ipynb b/Python/Functions_Advanced_English.ipynb new file mode 100644 index 0000000..a16c606 --- /dev/null +++ b/Python/Functions_Advanced_English.ipynb @@ -0,0 +1,102 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Functions_Advanced_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyP1JxDzTiFDMpsL+bYY8CWG", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "sBjrT3cPVTjt", + "outputId": "23863919-b98c-4ad3-a8df-e92724d20099" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "60\n" + ] + } + ], + "source": [ + "# lambda func\n", + "\n", + "\n", + "x = lambda a,b,c : a*b*c\n", + "\n", + "c = x(10,3,2)\n", + "print(c)" + ] + }, + { + "cell_type": "code", + "source": [ + "def f(a) :\n", + " return lambda n : n*a\n", + "\n", + "c = f(10)\n", + "print(c)\n", + "\n", + "d = c(9)\n", + "print(d)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "RPEzC21KVigR", + "outputId": "e08d21e2-3e75-4b42-bd38-51a9a2a6505a" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + ". at 0x7f7ecbc45440>\n", + "90\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "oxLU40dcVndS" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/GlobalVariables_English.ipynb b/Python/GlobalVariables_English.ipynb new file mode 100644 index 0000000..ca56c4b --- /dev/null +++ b/Python/GlobalVariables_English.ipynb @@ -0,0 +1,72 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "GlobalVariables_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyN9k2yaUuWN5TBUPNwqtsYi", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "tKYHGOEKXseC", + "outputId": "47d6a2ba-ad47-4cc2-edc1-81bf447e4682" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "10\n", + "10\n" + ] + } + ], + "source": [ + "global r\n", + "r = 10\n", + "def fun() :\n", + " # r = 10\n", + " print(r)\n", + "fun()\n", + "print(r)" + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "i34LP2biZnUo" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/I_O_Python_English.ipynb b/Python/I_O_Python_English.ipynb new file mode 100644 index 0000000..e673ed5 --- /dev/null +++ b/Python/I_O_Python_English.ipynb @@ -0,0 +1,249 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "I/O-Python_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyNt3EooRyqbi/+rCRg+LcFu", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "z3PHK6CdMuWf", + "outputId": "a420514a-5fdf-4af2-e671-05b08470d477" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your name: Ritik\n" + ] + } + ], + "source": [ + "name = input(\"Enter your name: \")" + ] + }, + { + "cell_type": "code", + "source": [ + "print(name)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "b7bWmsN0ShsU", + "outputId": "b62d9bc9-f17d-438d-d546-22e95acd8251" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Ritik\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(name))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Jcs9nIwpSoTA", + "outputId": "11893ba2-6f61-4098-e269-2412abbd38e8" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "age = input(\"Enter your age: \")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "l_1KNhk4St8H", + "outputId": "24d8ff75-1feb-49f2-ea28-b88da3912e79" + }, + "execution_count": null, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your age: 21\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(age, type(age))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "dxDKKOr-S50E", + "outputId": "c13f132d-d90d-4ab4-977f-5bc7a475eb1d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "21 \n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "age = int(input(\"Enter your age: \"))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "QNGa6XvlS-OF", + "outputId": "d9450253-534c-4045-d1b3-6ea670de6167" + }, + "execution_count": null, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your age: 21\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(age, type(age))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4dtUf2KxTExr", + "outputId": "bf9131f9-98d2-40af-f92a-53a806e10dd1" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "21 \n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "salary = float(input(\"Enter your salary: \"))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "abysRY4uTJDK", + "outputId": "4b04904f-a872-4319-ceb3-2962261645ed" + }, + "execution_count": null, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your salary: 29.9\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(salary))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Nb2lBgj7Thon", + "outputId": "21c63e3e-2e76-427c-8e03-2543ea7fa46d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "VtJVoki0Tn-Y" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/List_English.ipynb b/Python/List_English.ipynb new file mode 100644 index 0000000..32de02c --- /dev/null +++ b/Python/List_English.ipynb @@ -0,0 +1,411 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "List_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyN/AlRqw09/Hv3EuxbvQlSU", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "8bfunD47TJm4" + }, + "outputs": [], + "source": [ + "#list\n", + "\n", + "lst = [1,5,6]" + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(lst))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zcZVYIX3Z0_U", + "outputId": "bd6929da-ef16-44a2-8d25-5cc84f6fa6ca" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst.append(7)" + ], + "metadata": { + "id": "SM4W_N9GZ3GG" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "lst.append(\"Pepcoding\")" + ], + "metadata": { + "id": "yR2sVSVjZ4zt" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(lst)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "QbLWAG0HZ6d6", + "outputId": "08539aeb-cb94-4412-bf92-2ede63aa4178" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "[1, 5, 6, 7, 'Pepcoding']\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst[0]=500" + ], + "metadata": { + "id": "LD1rkNNEZ8vE" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "lst2 = [1,1]" + ], + "metadata": { + "id": "RAEF300tZ_LM" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "lst2.append(lst)" + ], + "metadata": { + "id": "tei7QpT5aA6E" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(lst2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "2qP5awQSaChf", + "outputId": "451c2ea6-f403-44c7-e7b8-37340d65f4cb" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "[1, 1, [500, 5, 6, 7, 'Pepcoding']]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst.append(5)" + ], + "metadata": { + "id": "KNpOceGLaF-p" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(lst)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zCNEmr95aIFS", + "outputId": "fdafc273-ee15-49f4-a5c3-fca3ff01390c" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "[500, 5, 6, 7, 'Pepcoding', 5]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst[-1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7EWzJKkcaKiF", + "outputId": "34f49c29-eb63-417b-8712-8ae546bd4bee" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "5" + ] + }, + "metadata": {}, + "execution_count": 12 + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst[0:2]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "nmkQlL4VaMZ3", + "outputId": "d73470f4-abeb-400d-f241-a66193a054a8" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "[500, 5]" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst.insert(2,\"Pepcoder\")" + ], + "metadata": { + "id": "Mu3U6XTtaOHS" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(lst)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "gJ8RVsvGaP16", + "outputId": "9981d3b6-8611-48f6-f01c-3b6e23d65d76" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "[500, 5, 'Pepcoder', 6, 7, 'Pepcoding', 5]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "lst.remove(6)" + ], + "metadata": { + "id": "CZ86p1TgaRxy" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(lst)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "l3_UDgzraULz", + "outputId": "3a87530b-acb3-4b59-8598-4307af376514" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "[500, 5, 'Pepcoder', 7, 'Pepcoding', 5]\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(lst.pop())" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "2CrfJnLTaWGG", + "outputId": "45033b7d-c296-4e54-cf94-77f7db9e4230" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "5\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "for i in lst:\n", + " print(i)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "L3dzgukbaYPz", + "outputId": "32d6e864-65bc-449e-e067-b20b69bbd798" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "500\n", + "5\n", + "Pepcoder\n", + "7\n", + "Pepcoding\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# constructor method\n", + "lst3 = list((1, 2, \"Pepcoding\"))\n", + "print(type(lst3))\n", + "print(lst3)" + ], + "metadata": { + "id": "VCsh9OMiaatA", + "outputId": "c0abb487-9640-47b6-8b74-e1fe79974e77", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "execution_count": 1, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "[1, 2, 'Pepcoding']\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "Ztcbsjqec2qR" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Loops_English.ipynb b/Python/Loops_English.ipynb new file mode 100644 index 0000000..abbc154 --- /dev/null +++ b/Python/Loops_English.ipynb @@ -0,0 +1,309 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Loops_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyOnM1ro4wXLrD2HCJp60RlA", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "WQxvIzKoAVtJ" + }, + "outputs": [], + "source": [ + "# loops" + ] + }, + { + "cell_type": "code", + "source": [ + "# while loop\n", + "\n", + "print(\"Hard code method! \\n\")\n", + "\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "\n", + "print(\"\\n\\n\")\n", + "\n", + "print(\"While loop method! \\n\")\n", + "\n", + "i = 1\n", + "while i <= 5 :\n", + " print(\"Hello Pepcoding\")\n", + " i += 1" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ztdRwAO2AgPz", + "outputId": "a0f4dd8a-2ddd-474b-a730-0fd8f6fd225a" + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Hard code method! \n", + "\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "\n", + "\n", + "\n", + "While loop method! \n", + "\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# break and continue keyword\n", + "\n", + "i = 1\n", + "while i <= 5 :\n", + " if i == 3 :\n", + " break\n", + " print(\"Hello Pepcoding : \", i)\n", + " i += 1\n", + "\n", + "print(\"\\n\")\n", + "\n", + "i = 1\n", + "while i <= 5 :\n", + " if i == 3 :\n", + " i += 1\n", + " continue\n", + " print(\"Hello Pepcoding : \", i)\n", + " i += 1" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Gp9qIS9yDro2", + "outputId": "130a025f-8638-4e47-bb80-1437be18931d" + }, + "execution_count": 13, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Hello Pepcoding : 1\n", + "Hello Pepcoding : 2\n", + "\n", + "\n", + "Hello Pepcoding : 1\n", + "Hello Pepcoding : 2\n", + "Hello Pepcoding : 4\n", + "Hello Pepcoding : 5\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# while-else loop\n", + "\n", + "i = 1\n", + "while i <= 5 :\n", + " print(\"Hello Pepcoding : \", i)\n", + " i += 1\n", + "else :\n", + " print(\"No break found\")\n", + "\n", + "\n", + "print(\"\\n\")\n", + "\n", + "i = 1\n", + "while i <= 5 :\n", + " if i == 3 :\n", + " break\n", + " print(\"Hello Pepcoding : \", i)\n", + " i += 1\n", + "else :\n", + " print(\"No break found\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "BzsGoXT0BM9-", + "outputId": "584713c5-5a23-405c-c63d-35f3429423e8" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Hello Pepcoding : 1\n", + "Hello Pepcoding : 2\n", + "Hello Pepcoding : 3\n", + "Hello Pepcoding : 4\n", + "Hello Pepcoding : 5\n", + "No break found\n", + "\n", + "\n", + "Hello Pepcoding : 1\n", + "Hello Pepcoding : 2\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# for loop\n", + "\n", + "print(\"Hard code method! \\n\")\n", + "\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "print(\"Hello Pepcoding\")\n", + "\n", + "print(\"\\n\\n\")\n", + "\n", + "print(\"For loop method! \\n\")\n", + "\n", + "for i in range(5):\n", + " print(\"Hello Pepcoding\")\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ZrLu5ZZiE0cd", + "outputId": "cbffd324-6155-4c94-d47d-42e73bbf7054" + }, + "execution_count": 14, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Hard code method! \n", + "\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "\n", + "\n", + "\n", + "For loop method! \n", + "\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n", + "Hello Pepcoding\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# for-else loop\n", + "\n", + "for i in range(5) :\n", + " print(\"Hello Pepcoding : \", i)\n", + "else :\n", + " print(\"No break found\")\n", + "\n", + "\n", + "print(\"\\n\")\n", + "\n", + "for i in range(5):\n", + " if i == 3 :\n", + " break\n", + " print(\"Hello Pepcoding : \", i)\n", + "else :\n", + " print(\"No break found\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "vLaeDHy4HvBe", + "outputId": "f0b864ef-a48d-4edb-ec3a-a29aa8a1f340" + }, + "execution_count": 15, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Hello Pepcoding : 0\n", + "Hello Pepcoding : 1\n", + "Hello Pepcoding : 2\n", + "Hello Pepcoding : 3\n", + "Hello Pepcoding : 4\n", + "No break found\n", + "\n", + "\n", + "Hello Pepcoding : 0\n", + "Hello Pepcoding : 1\n", + "Hello Pepcoding : 2\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "vxJzQB-dIUK5" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Operators_English.ipynb b/Python/Operators_English.ipynb new file mode 100644 index 0000000..e7e7e84 --- /dev/null +++ b/Python/Operators_English.ipynb @@ -0,0 +1,490 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Operators_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyPM6DeUwALjm2xngi2hOHbZ", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "QLllOyxIyc_z", + "outputId": "81ab843e-eb8a-494f-ca76-b437e6318a0e" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "30\n" + ] + } + ], + "source": [ + "# Arithmetic\n", + "\n", + "a = 10\n", + "b = 20\n", + "print(a + b)" + ] + }, + { + "cell_type": "code", + "source": [ + "print(a / b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4QMMLEDr080V", + "outputId": "8cd2333b-38bc-4c21-ea87-c01ab0624019" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "0.5\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a % b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "hNpvBVYX0-xy", + "outputId": "4733ef33-6527-480f-87af-aacc289d3e49" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "10\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(10 ** a)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "xKPhZfmi1A72", + "outputId": "89d9901e-1920-479e-b024-d97db21bf422" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "10000000000\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a // b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Y-QzP6_G1JXm", + "outputId": "350443eb-ac8e-46b4-9784-b8dc4f6983b5" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "0\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Assignment Operator\n", + "\n", + "a = 10" + ], + "metadata": { + "id": "yxuuOP7s1adE" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "b += a" + ], + "metadata": { + "id": "6QfGed2R1nti" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(a, b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "cuGgYJFk1oqf", + "outputId": "616b1e86-2c8c-471e-bcea-2a3cabc0f8cd" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "10 30\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "a **= 10" + ], + "metadata": { + "id": "KJQ8sjtc1rNg" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(a)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "I5Hn6L0D1wlq", + "outputId": "fa662f26-6ac6-49b2-ccd4-7dd033f6c60e" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "10000000000\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Comparison Operator\n", + "\n", + "print(a == b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "hKxBY4Gx1x54", + "outputId": "9182f635-f2ca-4dae-ebb3-8b4836eed833" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "False\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a > b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "ly80xlNG1908", + "outputId": "65b0ee5a-c41d-4452-9e45-f410562cfb40" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a != b)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "dIlI197r2iOj", + "outputId": "73ced0eb-d87a-4ee5-e5e3-58d53f3806ef" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# more are: \">\" \"<\" \">=\" \"<=\" \"!=\"" + ], + "metadata": { + "id": "wea9jfQU2mcV" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# Logical Operators\n", + "\n", + "# like: and, or, not\n", + "a = \"pepcoding\"\n", + "b = \"Namaste\"\n", + "print(a == \"pepcoding\" and b == \"Namaste\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "CyyhzYp_2ykE", + "outputId": "eb91b269-c853-4bbb-8043-740412f96b13" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a == \"pp\" and b == \"Namaste\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "P2o_aASo3MJ-", + "outputId": "c23782f4-7199-493f-b08b-f3b05efc43f0" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "False\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a == \"pepcoding\" and b == \"Nan\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "WtXA25Xq3QTC", + "outputId": "1b643015-983f-4884-b247-37847aee3541" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "False\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a == \"pepcoding\" or b == \"Namaste\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "NmirGMJF3UZh", + "outputId": "7086529d-d2ae-466c-d9b8-108e11aa4399" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a == \"pp\" or b == \"Namaste\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "hhRT85kL3YeN", + "outputId": "6f6af50c-883c-4315-f11d-2872d7b94fc0" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(a == \"pepcoding\" or b == \"Nan\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "yTuHRGKH3abI", + "outputId": "776dc1d2-4583-4351-9079-563c4730363b" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(not(a == \"pepcoding\" and b == \"Nan\"))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "1fpArzks3cZu", + "outputId": "143bf6a6-8612-44c1-ba23-23d065dd6afb" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "True\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "2Ss3iNoV3jQP" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/README.md b/Python/README.md new file mode 100644 index 0000000..eee5031 --- /dev/null +++ b/Python/README.md @@ -0,0 +1,94 @@ +# Python Course Overview + +## Introduction + +- [x] Python +- [x] Why Python for Data Science +- [x] Setting up Environment + - [x] Google Colab + - [x] Jupyter Notebook + +## Basics + +- [x] Why we need variables | Types of variables +- [x] I/O in Python +- [ ] Why we need operators | Types of operators +- [x] Conditional Operators + - [x] If-Else Statement +- [x] Why we need loops +- [x] Loops + - [x] While loop + - [x] Basics + - [x] continue and break keywords + - [x] While Else + - [x] For loop + - [x] Range Method + - [x] For Else +- [x] Code Indentation in Python +- [ ] Why do we need functions? +- [ ] Implementing basic functions + +## Fundamentals Of Python + +- [ ] What are Arrays? +- [ ] Implementing Arrays in Python +- [x] Lists + - [x] What are Lists in Python + - [x] Implementing Lists in Python + - [x] Basic operations on Lists + - [x] append + - [x] insert + - [x] remove + - [x] pop + - [x] Constructor Implementation +- [x] Tuples + - [x] What are Tuples in Python + - [x] Implementing Tuples in Python + - [x] Basic operations on Tuples + - [x] tuple object does not support item assignment + - [x] tuple object does not append method + - [x] Constructor Implementation +- [x] Sets + - [x] What are Sets in Python + - [x] Implementing Sets in Python + - [ ] Basics operations on Sets + - [ ] set object is not subscriptable + - [ ] add + - [ ] remove + - [ ] pop + - [ ] clear + - [ ] del + - [ ] Union & Intersection in Sets + - [ ] Updates in Sets Data Structure in new version of python + - [ ] Constructor Implementation +- [ ] Packages in Python +- [ ] Standard Library in Python +- [ ] Global Variables +- [ ] Casting in python specific data type +- [ ] Strings + - [ ] Slicing + - [ ] Standard string modifiers + - [ ] Upper, lower + - [ ] Replace, Split + - [ ] Concatenation of String + - [ ] What happens when concat string and number + - [ ] Format function +- [ ] Advanced Functions + - [ ] Lambda Functions + - [ ] Basics functions containing lambda functions +- [ ] Dictionary + - [ ] What is a dictionary? + - [ ] Implementing a dictionary in Python. + - [ ] Functions of dictionary + - [ ] pop + - [ ] keys + - [ ] values + - [ ] copy + - [ ] del +- [ ] Recap of List, Sets, Tuples and Dictionary +- [ ] Error Handling + - [ ] Need of error handling + - [ ] Protective Approach using if-else statement + - [ ] Try and Except + - [ ] finally + - [ ] raise diff --git a/Python/Set_English.ipynb b/Python/Set_English.ipynb new file mode 100644 index 0000000..f5b1e03 --- /dev/null +++ b/Python/Set_English.ipynb @@ -0,0 +1,438 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Set_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyMvque0LGgny9kALiB2a3bR", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "oYkr7qc9dUH7" + }, + "outputs": [], + "source": [ + "st = {\"Apple\", \"Banana\", \"Mango\"}" + ] + }, + { + "cell_type": "code", + "source": [ + "print(st)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "GGFovFaTdlsW", + "outputId": "8270bc42-271c-4a4f-9dbe-83695e43600c" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{'Apple', 'Banana', 'Mango'}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "st[0]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "cPz-LHG4dpNC", + "outputId": "cec9b485-ee97-4f6b-f484-8597dc809991" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "TypeError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mst\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m: 'set' object is not subscriptable" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "st = {\"Apple\", \"Banana\", \"Mango\", \"Banana\", 5, 6}" + ], + "metadata": { + "id": "UXcQ-t9Wdq5J" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "st" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "pgpOEtdedxPt", + "outputId": "5a947a1f-5653-41e4-c921-0678d0e3c126" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{5, 6, 'Apple', 'Banana', 'Mango'}" + ] + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [ + "#sets are immutable\n", + "\n", + "st.add(\"Orange\")" + ], + "metadata": { + "id": "s2jCD5-7d0ij" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "st.remove('Banana')" + ], + "metadata": { + "id": "Ogp6ZEZid3QL" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "st = {1, 2, 3, [\"Apple\", \"orange\"]}" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "5UD3Y3uXd5KP", + "outputId": "32d01bf4-1f01-4324-ad86-745ca958dd95" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "TypeError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mst\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"Apple\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"orange\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m: unhashable type: 'list'" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "st = {1, 2, 3, (\"Apple\", \"orange\")}" + ], + "metadata": { + "id": "AVkRcZv7d7Gk" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "st" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "kn-n_1PSeDzE", + "outputId": "25ec8306-0102-4883-d131-9551d08d0af6" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "{('Apple', 'orange'), 1, 2, 3}" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ] + }, + { + "cell_type": "code", + "source": [ + "for x in st:\n", + " print(x)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "9sLcSgwPeFmT", + "outputId": "706b926d-b300-4136-fed8-241729fe7abb" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "1\n", + "2\n", + "3\n", + "('Apple', 'orange')\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "st.pop()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "gMugv9-5eHfG", + "outputId": "bf4dff75-ef87-4b7a-c91a-b99f7148add9" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "1" + ] + }, + "metadata": {}, + "execution_count": 15 + } + ] + }, + { + "cell_type": "code", + "source": [ + "st.clear()" + ], + "metadata": { + "id": "DwWcFo1xeJ9z" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "st" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "y3l_58B-eN0d", + "outputId": "61c5e31d-863c-46d9-c83f-8553ed678ba2" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "set()" + ] + }, + "metadata": {}, + "execution_count": 17 + } + ] + }, + { + "cell_type": "code", + "source": [ + "del st" + ], + "metadata": { + "id": "W20AP1DDeOmZ" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "st" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "XANyD_UIePaA", + "outputId": "a2e93a9c-ad15-4515-813b-d7ce95094e98" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "NameError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mst\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mNameError\u001b[0m: name 'st' is not defined" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# union and intersection\n", + "\n", + "set1 = {1, 2, 3, 4, 5}\n", + "set2 = {2, 5, 8, 9}\n", + "\n", + "print(set1.union(set2))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "gpooCDboeRKm", + "outputId": "42c66b38-600d-4034-c3c1-b8d13b7555f3" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{1, 2, 3, 4, 5, 8, 9}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(set1.intersection(set2))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "MpzYLsOHeS2m", + "outputId": "a3baacc5-3f63-4305-ee57-c095ed45b60d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "{2, 5}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Constructor Implementation\n", + "\n", + "set3 = set((1, 2, 3, 4, 5))\n", + "print(type(set3))\n", + "print(set3)" + ], + "metadata": { + "id": "Ex32xdO8foCb", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "4a57d579-dff2-482d-ba20-1236d2557bb5" + }, + "execution_count": 23, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n", + "{1, 2, 3, 4, 5}\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "0E2YPGhWhrg3" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Strings_English.ipynb b/Python/Strings_English.ipynb new file mode 100644 index 0000000..77877f9 --- /dev/null +++ b/Python/Strings_English.ipynb @@ -0,0 +1,781 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Strings_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyOH9s4e0tsAubaHAlMSabHg", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "EbLqrwB1KKWA" + }, + "outputs": [], + "source": [ + "phrase = \"Pepcoding\"" + ] + }, + { + "cell_type": "code", + "source": [ + "print(phrase[0])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "p_UjJp1TK3G5", + "outputId": "ac7504de-ac62-4fc3-f57c-6274cba88397" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "P\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[0] = 'i'" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "1oBR4DprK4t_", + "outputId": "3c523644-2611-4868-c4a6-22accb5b8c0e" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "TypeError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mphrase\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'i'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m: 'str' object does not support item assignment" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[0 : 3]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "R8kFYlFFK7pN", + "outputId": "e7033f7b-9c91-4963-b2a7-d896ff17a9db" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'Pep'" + ] + }, + "metadata": {}, + "execution_count": 4 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[0 : ]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "-NHVcJUcK_Ck", + "outputId": "dff68f51-3edc-4961-c030-2f2c18e60399" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'Pepcoding'" + ] + }, + "metadata": {}, + "execution_count": 5 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[ : 3]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "5-2Xg7VULC5j", + "outputId": "d0cb4540-e561-4d92-dc27-46b3d95bf311" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'Pep'" + ] + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[ : ]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "WhWr9P4KLEDO", + "outputId": "66d15478-ed2f-4817-e496-a166e2c40f9f" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'Pepcoding'" + ] + }, + "metadata": {}, + "execution_count": 7 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[0 : 5 : 2]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "m967rZC6LGgh", + "outputId": "498fd33d-583a-401c-e2fe-3923e94dde3d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'Ppo'" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[7 : 1 : 1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "i7db0_kGLJtj", + "outputId": "0eb7608e-d935-4997-8d2a-ee53faa541e7" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "''" + ] + }, + "metadata": {}, + "execution_count": 9 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[7 : 1 : -1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "tr81HzIRLMvZ", + "outputId": "f8563e9f-9cb6-4c72-a574-2ba9368a0972" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'nidocp'" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[-1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "6BHqQ7CgLP33", + "outputId": "be0c4fce-60ee-426e-ecf1-a389f8199e31" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'g'" + ] + }, + "metadata": {}, + "execution_count": 11 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[-1 : -5 : -1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "E1ViE0e9LRFD", + "outputId": "5054a431-b22d-49e7-977e-a2363802dc62" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'gnid'" + ] + }, + "metadata": {}, + "execution_count": 12 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[ : : -1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "fUKskCauLiQO", + "outputId": "eb94310b-e3b7-4f12-b7c2-517d782dfe64" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'gnidocpeP'" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ] + }, + { + "cell_type": "code", + "source": [ + "len(phrase)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "HJ8DbiJULlTE", + "outputId": "86741353-195d-473d-84f9-4c55e6ff3c65" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "9" + ] + }, + "metadata": {}, + "execution_count": 14 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[-1 : -9 : -1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "odkTpuAZO620", + "outputId": "d80434d2-0c03-47d3-bb13-9dff6130e74f" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'gnidocpe'" + ] + }, + "metadata": {}, + "execution_count": 15 + } + ] + }, + { + "cell_type": "code", + "source": [ + "phrase[10 : 1]" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "g6Xm8iRuPC6q", + "outputId": "8c947834-23d8-476f-d3d5-2c023f4bfb90" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "''" + ] + }, + "metadata": {}, + "execution_count": 16 + } + ] + }, + { + "cell_type": "code", + "source": [ + "for ch in phrase:\n", + " print(ch)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "qXhG10i9PHrt", + "outputId": "7d4d41c9-e9e3-478c-b894-a81ed055620d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "P\n", + "e\n", + "p\n", + "c\n", + "o\n", + "d\n", + "i\n", + "n\n", + "g\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "if \"Pep\" in phrase:\n", + " print(\"Hello\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "706bP1PlPKSj", + "outputId": "2d3c760c-fc25-4e4a-8bcb-367c438b7415" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Hello\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# upper case\n", + "\n", + "phrase.upper()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "WBfH1G3OPMbx", + "outputId": "49040ae5-01dd-47f8-c029-8cb6afd7b21d" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'PEPCODING'" + ] + }, + "metadata": {}, + "execution_count": 19 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# lower case\n", + "\n", + "phrase.lower()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + }, + "id": "vs5oSYCPPQrn", + "outputId": "47fa181a-b074-40af-d7b8-0c8fe35df6af" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'pepcoding'" + ] + }, + "metadata": {}, + "execution_count": 20 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# split\n", + "\n", + "string = \"My name is Anthony Gonsalvis\"\n", + "\n", + "str2 = string.split(\" \")\n", + "print(str2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "gSzoK_ZfPSa_", + "outputId": "14f84e18-4a24-4a14-af73-d5902f4cc91e" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "['My', 'name', 'is', 'Anthony', 'Gonsalvis']\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(str2)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Jstxly9iPVwG", + "outputId": "600a5459-274a-4b51-dbae-0dd1835c42f3" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "['My', 'name', 'is', 'Anthony', 'Gonsalvis']\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# replace\n", + "\n", + "string.replace(\"Anthony\", \"Ritik\")" + ], + "metadata": { + "id": "D-pY0T-hPZsq", + "outputId": "1fc8a744-5522-44be-b0c3-a1273fc4368c", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 34 + } + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + }, + "text/plain": [ + "'My name is Ritik Gonsalvis'" + ] + }, + "metadata": {}, + "execution_count": 4 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Concatenation Of String\n", + "\n", + "str1 = \"Pep\"\n", + "str2 = \"Coding\"\n", + "print(\"String 1 : \", str1)\n", + "print(\"String 2 : \", str2)\n", + "str = str1 + str2\n", + "print(\"Concatenated two different strings : \",str)" + ], + "metadata": { + "id": "ZXQ3PjltkLkh", + "outputId": "626a7956-d841-4a4d-e0ce-b27199cab6c6", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "execution_count": 5, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "String 1 : Pep\n", + "String 2 : Coding\n", + "Concatenated two different strings : PepCoding\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Format Keyword\n", + "\n", + "txt = \"Pepcoding\"\n", + "\n", + "print(txt + 3000)" + ], + "metadata": { + "id": "yOa32bRuHWNz", + "outputId": "b34cadf1-4a32-4dae-a0e3-556a62288591", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 224 + } + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "error", + "ename": "TypeError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mtxt\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"Pepcoding\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtxt\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m3000\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtxt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m300\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "txt = \"Pepcoding have to create {price} lakh videos\"\n", + "print(txt.format(price = 3))" + ], + "metadata": { + "id": "U00qZpPLHiTZ", + "outputId": "04e552e5-df9a-4ce6-adf0-0657b974fec7", + "colab": { + "base_uri": "https://localhost:8080/" + } + }, + "execution_count": 15, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Pepcoding have to create 3 lakh videos\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "2009i1k6ILsW" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Try_Except_English.ipynb b/Python/Try_Except_English.ipynb new file mode 100644 index 0000000..c242d0d --- /dev/null +++ b/Python/Try_Except_English.ipynb @@ -0,0 +1,193 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Try-Except_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyPoHURCLtgeGGfIKCOZyrVB", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "L_TWHoqkJ1bt", + "outputId": "f01bb5bf-268d-438e-ec1c-22e2b44e5b88" + }, + "outputs": [ + { + "output_type": "error", + "ename": "ZeroDivisionError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;36m5\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero" + ] + } + ], + "source": [ + "5/0" + ] + }, + { + "cell_type": "code", + "source": [ + "a,b = 5,0\n", + "try:\n", + " test = \"Hello Peter Parker\"\n", + " print(pepcoding)\n", + "except ZeroDivisionError:\n", + " print(\"Division by zero happened\")\n", + "except NameError:\n", + " print(\"NameError Came\")\n", + "except:\n", + " print(\"Other Exception came\")\n", + "else:\n", + " print(\"Else Block Printed\")\n", + "\n", + "\n", + "print(\"Hello World\")" + ], + "metadata": { + "id": "s0sTbGIIMV4v" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "test = \"Hello Peter Parker\"\n", + "print(Pepcoding)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 175 + }, + "id": "ML4pnmghMbk6", + "outputId": "6c3b8782-6c30-49e7-8e81-52e4c588f14d" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "error", + "ename": "NameError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mtest\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"Hello Peter Parker\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mPepcoding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mNameError\u001b[0m: name 'Pepcoding' is not defined" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "a,b = 5,0\n", + "try:\n", + " test = \"Hello Peter Parker\"\n", + " print(pepcoding)\n", + "except ZeroDivisionError:\n", + " print(\"Division by zero happened\")\n", + "except NameError:\n", + " print(\"NameError Came\")\n", + "except:\n", + " print(\"Other Exception came\")\n", + "else:\n", + " print(\"Else Block Printed\")\n", + "finally:\n", + " print(\"Finally Block Printed\")\n", + "\n", + "\n", + "print(\"Hello World\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "BbAhZcDXMegt", + "outputId": "6e0860bc-2239-4a53-9d5f-34ffd562aef2" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "NameError Came\n", + "Finally Block Printed\n", + "Hello World\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "raise Exception(\"List is empty\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "pd1pRWKEMhj4", + "outputId": "e7fc84b3-e746-4933-860e-31612c1c5ee3" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "error", + "ename": "Exception", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mException\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"List is empty\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mException\u001b[0m: List is empty" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "dtwGpnqZMk7Z" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/Tuples_English.ipynb b/Python/Tuples_English.ipynb new file mode 100644 index 0000000..0c1073b --- /dev/null +++ b/Python/Tuples_English.ipynb @@ -0,0 +1,263 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "Tuples_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyOE1EAapAilILuxLR5IynC+", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "5DTge4jDbapb" + }, + "outputs": [], + "source": [ + "tup = (1, 2, 3, \"Hello\")" + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(tup))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "_MCtQYl8bhan", + "outputId": "98df2197-6a43-4a01-e8fa-1acc1ad1a1b6" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "tup = 1, 2, 3, \"Hello\"" + ], + "metadata": { + "id": "LUgl5icUbjDD" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "tup2 = (99, )" + ], + "metadata": { + "id": "vr2Vqa7jbkot" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(type(tup2))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "dUx78ZYLbmIJ", + "outputId": "9aee354b-2012-4d05-a973-0f098a397d34" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(tup[0])" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "y1LCv7YLbsqd", + "outputId": "af9ae47d-cb03-4230-d1bf-dd933db84f71" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "1\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "tup[0] = 5" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "OJlJUbTpbuiQ", + "outputId": "848284f6-b484-4f93-8de6-7d840e058583" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "TypeError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtup\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m: 'tuple' object does not support item assignment" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "for i in tup:\n", + " print(i)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "HpU2QQIibwTM", + "outputId": "1dc19aff-9bab-4f44-ae5f-7e1959742527" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "1\n", + "2\n", + "3\n", + "Hello\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "tup.append(5)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 158 + }, + "id": "9isWLDECbzB3", + "outputId": "798f9102-b776-4b78-a48d-de419f9003bf" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "AttributeError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtup\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'append'" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "# contractor method\n", + "\n", + "tup3 = tuple((1, 2, 3))" + ], + "metadata": { + "id": "Ok5qVJ9Db1aL" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "print(tup3)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "_3Y8cImMb5mM", + "outputId": "da5e0303-b14b-4dea-8e98-638adf3c3730" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "(1, 2, 3)\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": { + "id": "saBTMGdlb-rs" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/Python/TypesOfVariables_English.ipynb b/Python/TypesOfVariables_English.ipynb new file mode 100644 index 0000000..e52300e --- /dev/null +++ b/Python/TypesOfVariables_English.ipynb @@ -0,0 +1,253 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "TypesOfVariables_English.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyNFaIr8gWQVDvv4ecRvnZx0", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "markdown", + "source": [ + "Python has no command to declare variables\n" + ], + "metadata": { + "id": "GA1qS6Fs_S9H" + } + }, + { + "cell_type": "code", + "source": [ + "num = 10" + ], + "metadata": { + "id": "9ym43OUP_Z9V" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "string = 'Pepcoding'" + ], + "metadata": { + "id": "sq_DvzPd_jZv" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "flt = 2.3" + ], + "metadata": { + "id": "ifPN60_a_mPL" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#case sensitive \n", + "\n", + "Flt = 3.3\n", + "print(flt)\n", + "print(Flt)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "CyGFsGFd_ny7", + "outputId": "41d3315f-c862-49ee-c07b-1f49b93610ca" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "2.3\n", + "3.3\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(num))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "X6q--RW2AFDf", + "outputId": "febd1247-5bac-434e-e32f-59b705d6c054" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "print(type(string), type(flt))" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "aO4tEdaPAI7g", + "outputId": "f22bd971-92dc-4c69-acf5-79fe8353d5a4" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " \n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "* A variable name must start with a letter or the underscore character\n", + "* A variable name cannot start with a number\n", + "* A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )\n", + "* Variable names are case-sensitive (age, Age and AGE are three different variables)" + ], + "metadata": { + "id": "EJCHVKJXAV85" + } + }, + { + "cell_type": "code", + "source": [ + "#some legal variables names\n", + "\n", + "pepcoding = \"pep\"\n", + "pep9coding = \"pep\"\n", + "_pepcoding = \"pep\"\n", + "pepcoding1 = \"pep\"\n", + "_pep_coding = \"pep\"\n", + "PEPcoding = \"pep\"" + ], + "metadata": { + "id": "lEUNJ92jAhR-" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#some illegal variables names\n", + "\n", + "pep-coding = \"pep\"\n", + "9pepcoding = \"pep\"" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 125 + }, + "id": "ewLjYfQmBLLo", + "outputId": "213890fe-27b7-4616-d030-6bfb324ed699" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "error", + "ename": "SyntaxError", + "evalue": "ignored", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m4\u001b[0m\n\u001b[0;31m 9pepcoding = \"pep\"\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "a,b,c = 10,20,30\n", + "print(a, b, c)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "6e3CGOFcBhn_", + "outputId": "7b042307-621d-4f24-cff2-b21804433f11" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "10 20 30\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "a=b=c=50\n", + "print(a,b,c)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7j4tJlDUBrWy", + "outputId": "ff470b12-c633-47ed-e663-61384ae5a895" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "50 50 50\n" + ] + } + ] + } + ] +} \ No newline at end of file