diff --git a/0_python/1_Basics.ipynb b/0_python/1_Basics.ipynb index 01010da..73cde70 100644 --- a/0_python/1_Basics.ipynb +++ b/0_python/1_Basics.ipynb @@ -165,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -220,7 +220,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -229,7 +229,7 @@ "3" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -240,7 +240,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -249,7 +249,7 @@ "1" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -347,7 +347,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -356,7 +356,7 @@ "5" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -374,7 +374,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -383,7 +383,7 @@ "1.0" ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -485,7 +485,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -495,7 +495,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -514,7 +514,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -523,7 +523,7 @@ "2" ] }, - "execution_count": 18, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -604,7 +604,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -613,7 +613,7 @@ "'0xaa'" ] }, - "execution_count": 20, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -624,7 +624,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -633,7 +633,7 @@ "170" ] }, - "execution_count": 21, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -644,7 +644,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -653,7 +653,7 @@ "'0o10'" ] }, - "execution_count": 22, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -671,7 +671,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -699,7 +699,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -807,7 +807,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -832,7 +832,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -841,7 +841,7 @@ "(4, 1)" ] }, - "execution_count": 28, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -917,7 +917,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -943,7 +943,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -978,14 +978,14 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Type something here and it will be stored in variable abc \t10\n" + "Type something here and it will be stored in variable abc \t20\n" ] } ], @@ -995,7 +995,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 26, "metadata": {}, "outputs": [ { @@ -1004,7 +1004,7 @@ "str" ] }, - "execution_count": 33, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } diff --git a/0_python/2_Print_Statement.ipynb b/0_python/2_Print_Statement.ipynb index 16c2bfe..4d9b5e9 100644 --- a/0_python/2_Print_Statement.ipynb +++ b/0_python/2_Print_Statement.ipynb @@ -47,7 +47,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -98,7 +98,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "metadata": { "scrolled": true }, @@ -129,7 +129,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -153,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -186,7 +186,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -218,7 +218,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -249,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -266,7 +266,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -283,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -307,7 +307,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -331,7 +331,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -348,7 +348,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -390,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -399,7 +399,7 @@ "'3.121312'" ] }, - "execution_count": 18, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -417,7 +417,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -426,7 +426,7 @@ "'3.12131'" ] }, - "execution_count": 19, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -444,7 +444,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -453,7 +453,7 @@ "'-33.12131'" ] }, - "execution_count": 25, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -471,7 +471,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -480,7 +480,7 @@ "'00000000000003.12131'" ] }, - "execution_count": 17, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -498,7 +498,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -511,8 +511,8 @@ } ], "source": [ - "print \"% 9f\" % 3.121312312312\n", - "print \"% 9f\" % -3.121312312312" + "print(\"% 9f\" % 3.121312312312)\n", + "print(\"% 9f\" % -3.121312312312)" ] }, { @@ -524,7 +524,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -537,8 +537,8 @@ } ], "source": [ - "print \"%+9f\" % 3.121312312312\n", - "print \"% 9f\" % -3.121312312312" + "print(\"%+9f\" % 3.121312312312)\n", + "print(\"% 9f\" % -3.121312312312)" ] }, { diff --git a/0_python/3_Data_Structure_1.ipynb b/0_python/3_Data_Structure_1.ipynb index 37b2966..d01b00e 100644 --- a/0_python/3_Data_Structure_1.ipynb +++ b/0_python/3_Data_Structure_1.ipynb @@ -65,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -106,7 +106,7 @@ "'apple'" ] }, - "execution_count": 2, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -124,7 +124,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -133,7 +133,7 @@ "'peach'" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -151,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -167,19 +167,19 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[['apple', 'orange', 'peach'], ['carrot', 'potato']]\n" + "[['apple', 'orange', 'peach'], ['carrot', 'potato'], 'Test']\n" ] } ], "source": [ - "z = [x,y]\n", + "z = [x,y, 'Test']\n", "print(z)" ] }, @@ -215,7 +215,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -240,7 +240,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -249,7 +249,7 @@ "'apple'" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -267,7 +267,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -276,7 +276,7 @@ "'apple'" ] }, - "execution_count": 13, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -310,7 +310,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -319,6 +319,7 @@ "text": [ "[3, 2, 3]\n", "[2, 3, 2, 3, 4, 5, 6, 7, 8, 9]\n", + "[2, 3, 2, 3, 4, 5, 6, 7, 8, 9]\n", "[2, 3, 2, 3, 4, 5, 6, 7, 8, 9]\n" ] } @@ -327,12 +328,13 @@ "num = [2,3,2,3,4,5,6,7,8,9]\n", "print(num[1:4])\n", "print(num[0:])\n", - "print(num[:])" + "print(num[:])\n", + "print(num)" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -358,7 +360,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -367,7 +369,7 @@ "[2, 3, 6]" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -392,7 +394,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -401,7 +403,7 @@ "10" ] }, - "execution_count": 13, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -419,27 +421,35 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 20, "metadata": {}, "outputs": [ { + "name": "stdout", + "output_type": "stream", + "text": [ + "[2, 3, 2, 3, 4, 5, 6, 7, 8, 9]\n" + ] + }, + { "data": { "text/plain": [ - "0" + "2" ] }, - "execution_count": 14, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "print(num)\n", "min(num)" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -448,7 +458,7 @@ "9" ] }, - "execution_count": 15, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -466,7 +476,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -475,7 +485,7 @@ "[1, 2, 3, 5, 4, 7]" ] }, - "execution_count": 16, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -493,7 +503,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -509,7 +519,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -518,7 +528,7 @@ "False" ] }, - "execution_count": 18, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -596,7 +606,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -605,7 +615,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -631,7 +641,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -640,7 +650,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -673,7 +683,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -704,7 +714,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -713,7 +723,7 @@ "['h', 'e', 'l', 'l', 'o']" ] }, - "execution_count": 24, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -731,7 +741,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -740,7 +750,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -765,7 +775,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -774,7 +784,7 @@ "3" ] }, - "execution_count": 46, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -792,7 +802,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -801,15 +811,25 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 4, 8, 7, 1, [5, 4, 2, 8]]\n" + "[1, 1, 4, 8, 7, 1, [5, 4, 2, 8], [5, 4, 2, 8]]\n" ] + }, + { + "data": { + "text/plain": [ + "[1, 1, 4, 8, 7, 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 4, 2, 8]" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -826,14 +846,14 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 4, 8, 7, 1, [5, 4, 2, 8], 5, 4, 2, 8]\n" + "[1, 1, 4, 8, 7, 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 4, 2, 8]\n" ] } ], @@ -851,7 +871,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -860,7 +880,7 @@ "0" ] }, - "execution_count": 50, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -871,7 +891,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -879,9 +899,9 @@ "evalue": "999 is not in list", "output_type": "error", "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\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[0mlst\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m999\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31m------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0mTraceback (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[0mlst\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m999\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mValueError\u001b[0m: 999 is not in list" ] } @@ -899,14 +919,14 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 39, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 4, 8, 7, 'name', 1, [5, 4, 2, 8], 5, 4, 2, 8]\n" + "[1, 1, 4, 8, 7, 'name', 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 4, 2, 8]\n" ] } ], @@ -924,14 +944,14 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 40, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 4, 8, 7, 'Python', 1, [5, 4, 2, 8], 5, 4, 2, 8]\n" + "[1, 1, 4, 8, 7, 'Python', 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 4, 2, 8]\n" ] } ], @@ -949,16 +969,16 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[1, 1, 4, 8, 7, 'Python', 1, [5, 4, 2, 8], 5, 4, 2]" + "[1, 1, 4, 8, 7, 'Python', 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 4, 2]" ] }, - "execution_count": 54, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -977,7 +997,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -986,7 +1006,7 @@ "4" ] }, - "execution_count": 55, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -997,14 +1017,14 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 8, 7, 'Python', 1, [5, 4, 2, 8], 5, 4, 2]\n" + "[1, 1, 8, 7, 'Python', 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 4, 2]\n" ] }, { @@ -1013,7 +1033,7 @@ "4" ] }, - "execution_count": 57, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -1025,14 +1045,14 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 8, 7, 'Python', 1, [5, 4, 2, 8], 5, 2]\n" + "[1, 1, 8, 7, 'Python', 1, [5, 4, 2, 8], [5, 4, 2, 8], 5, 2]\n" ] } ], @@ -1049,14 +1069,18 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 46, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "[1, 1, 8, 7, 1, [5, 4, 2, 8], 5, 2]\n" + "ename": "ValueError", + "evalue": "list.remove(x): x not in list", + "output_type": "error", + "traceback": [ + "\u001b[0;31m------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0mTraceback (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[0mlst\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mremove\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Python'\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 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlst\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: list.remove(x): x not in list" ] } ], @@ -1074,15 +1098,15 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 52, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[1, 1, 8, 7, 1, [5, 4, 2, 8], 5, 2]\n", - "[1, 8, 7, 1, [5, 4, 2, 8], 5, 2]\n" + "[1, [5, 4, 2, 8], 5, 2]\n", + "[1, 5, 2]\n" ] } ], @@ -1101,14 +1125,14 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 53, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[2, 5, [5, 4, 2, 8], 1, 7, 8, 1]\n" + "[2, 5, 1]\n" ] } ], @@ -1128,7 +1152,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -1154,14 +1178,18 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 56, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "[10, 8, 8, 4, 1]\n" + "ename": "TypeError", + "evalue": "must use keyword argument for key function", + "output_type": "error", + "traceback": [ + "\u001b[0;31m------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0mTraceback (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[0mlst\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msort\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mTrue\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 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlst\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: must use keyword argument for key function" ] } ], @@ -1179,7 +1207,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -1208,7 +1236,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 58, "metadata": {}, "outputs": [ { @@ -1243,7 +1271,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -1252,7 +1280,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 60, "metadata": {}, "outputs": [ { @@ -1277,7 +1305,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -1298,7 +1326,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 62, "metadata": {}, "outputs": [ { @@ -1324,7 +1352,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 63, "metadata": {}, "outputs": [], "source": [ @@ -1333,7 +1361,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 64, "metadata": {}, "outputs": [ { @@ -1351,7 +1379,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 65, "metadata": {}, "outputs": [ { @@ -1372,7 +1400,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 66, "metadata": {}, "outputs": [ { @@ -1410,7 +1438,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 68, "metadata": {}, "outputs": [ { @@ -1420,12 +1448,24 @@ "(3, 1)\n", "\n" ] + }, + { + "ename": "TypeError", + "evalue": "'tuple' object does not support item assignment", + "output_type": "error", + "traceback": [ + "\u001b[0;31m------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0mTraceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mxyz\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mxyz\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;32m----> 4\u001b[0;31m \u001b[0mxyz\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m10\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" + ] } ], "source": [ "xyz = divmod(10,3)\n", "print(xyz)\n", - "print(type(xyz))" + "print(type(xyz))\n", + "xyz[0]=10" ] }, { @@ -1444,7 +1484,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 69, "metadata": {}, "outputs": [], "source": [ @@ -1461,7 +1501,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 74, "metadata": {}, "outputs": [ { @@ -1470,7 +1510,7 @@ "(27,)" ] }, - "execution_count": 76, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } @@ -1488,7 +1528,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 75, "metadata": {}, "outputs": [ { @@ -1497,7 +1537,7 @@ "(27, 27)" ] }, - "execution_count": 79, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } @@ -1515,7 +1555,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 76, "metadata": { "scrolled": true }, @@ -1545,7 +1585,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 77, "metadata": {}, "outputs": [ { @@ -1572,7 +1612,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 80, "metadata": {}, "outputs": [], "source": [ @@ -1598,7 +1638,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 81, "metadata": {}, "outputs": [ { @@ -1630,7 +1670,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 82, "metadata": {}, "outputs": [ { @@ -1639,7 +1679,7 @@ "3" ] }, - "execution_count": 59, + "execution_count": 82, "metadata": {}, "output_type": "execute_result" } @@ -1657,7 +1697,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 83, "metadata": {}, "outputs": [ { @@ -1666,7 +1706,7 @@ "1" ] }, - "execution_count": 60, + "execution_count": 83, "metadata": {}, "output_type": "execute_result" } @@ -1693,7 +1733,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 85, "metadata": {}, "outputs": [ { @@ -1711,7 +1751,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 87, "metadata": {}, "outputs": [ { @@ -1729,7 +1769,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 88, "metadata": {}, "outputs": [ { @@ -1761,7 +1801,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 89, "metadata": {}, "outputs": [], "source": [ @@ -1770,7 +1810,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 90, "metadata": {}, "outputs": [], "source": [ @@ -1786,7 +1826,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 91, "metadata": {}, "outputs": [ { @@ -1795,7 +1835,7 @@ "{1, 2, 3, 4, 5}" ] }, - "execution_count": 89, + "execution_count": 91, "metadata": {}, "output_type": "execute_result" } @@ -1813,7 +1853,7 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 92, "metadata": {}, "outputs": [ { @@ -1829,7 +1869,7 @@ "{0, 1, 2, 3}" ] }, - "execution_count": 90, + "execution_count": 92, "metadata": {}, "output_type": "execute_result" } @@ -1849,7 +1889,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 93, "metadata": {}, "outputs": [ { @@ -1858,7 +1898,7 @@ "{2, 3}" ] }, - "execution_count": 91, + "execution_count": 93, "metadata": {}, "output_type": "execute_result" } @@ -1876,7 +1916,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 94, "metadata": {}, "outputs": [ { @@ -1893,7 +1933,7 @@ "{0, 1}" ] }, - "execution_count": 93, + "execution_count": 94, "metadata": {}, "output_type": "execute_result" } @@ -1913,7 +1953,7 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 95, "metadata": {}, "outputs": [ { @@ -1922,7 +1962,7 @@ "{0, 1, 4, 5}" ] }, - "execution_count": 94, + "execution_count": 95, "metadata": {}, "output_type": "execute_result" } @@ -1940,7 +1980,7 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 96, "metadata": {}, "outputs": [ { @@ -1949,7 +1989,7 @@ "False" ] }, - "execution_count": 95, + "execution_count": 96, "metadata": {}, "output_type": "execute_result" } @@ -1960,7 +2000,7 @@ }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 97, "metadata": {}, "outputs": [ { @@ -1969,7 +2009,7 @@ "False" ] }, - "execution_count": 96, + "execution_count": 97, "metadata": {}, "output_type": "execute_result" } @@ -2007,14 +2047,23 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 115, + "metadata": {}, + "outputs": [], + "source": [ + "set1=set([10, 9, 1, 2, 4])" + ] + }, + { + "cell_type": "code", + "execution_count": 113, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{1, 2, 3}\n" + "set()\n" ] } ], @@ -2032,16 +2081,16 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 116, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{1, 3}" + "{1, 4, 9, 10}" ] }, - "execution_count": 99, + "execution_count": 116, "metadata": {}, "output_type": "execute_result" } @@ -2060,7 +2109,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 117, "metadata": {}, "outputs": [ { @@ -2069,7 +2118,7 @@ "set()" ] }, - "execution_count": 100, + "execution_count": 117, "metadata": {}, "output_type": "execute_result" } diff --git a/0_python/4_Data_Structure_2.ipynb b/0_python/4_Data_Structure_2.ipynb index 62bd8e8..0b5f648 100644 --- a/0_python/4_Data_Structure_2.ipynb +++ b/0_python/4_Data_Structure_2.ipynb @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -94,7 +94,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -122,7 +122,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -146,7 +146,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -172,7 +172,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -197,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -206,7 +206,7 @@ "' Taj Mahal is beautiful '" ] }, - "execution_count": 11, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -224,7 +224,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -233,7 +233,7 @@ "'------------------------Taj Mahal is beautiful------------------------'" ] }, - "execution_count": 12, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -251,7 +251,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -260,7 +260,7 @@ "'00000000Taj Mahal is beautiful'" ] }, - "execution_count": 13, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -278,7 +278,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -287,7 +287,7 @@ "text": [ "h\te\tl\tl\to\n", "h e l l o\n", - "h e l l o\n" + "h e l l o\n" ] } ], @@ -295,7 +295,7 @@ "s = 'h\\te\\tl\\tl\\to'\n", "print(s)\n", "print(s.expandtabs(1))\n", - "print(s.expandtabs())" + "print(s.expandtabs(4))" ] }, { @@ -309,7 +309,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -325,9 +325,9 @@ "evalue": "substring not found", "output_type": "error", "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\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[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mString0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Taj'\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[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mString0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Mahal'\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[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mString0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Mahal'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m20\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;31m------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0mTraceback (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[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mString0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Taj'\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[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mString0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Mahal'\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[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mString0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Mahal'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m20\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;31mValueError\u001b[0m: substring not found" ] } @@ -347,7 +347,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -371,7 +371,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -397,7 +397,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -423,7 +423,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -432,7 +432,7 @@ "'*a_a-'" ] }, - "execution_count": 19, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -443,7 +443,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -452,7 +452,7 @@ "'1\\n2'" ] }, - "execution_count": 20, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -477,7 +477,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -505,7 +505,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -530,7 +530,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -555,7 +555,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -582,7 +582,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -608,7 +608,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -617,7 +617,7 @@ "'TAJ MAHAL IS BEAUTIFUL'" ] }, - "execution_count": 12, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -635,7 +635,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -644,7 +644,7 @@ "'Bengaluru is beautiful'" ] }, - "execution_count": 22, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -662,7 +662,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -678,7 +678,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -687,7 +687,7 @@ "'hello'" ] }, - "execution_count": 25, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -705,7 +705,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -714,7 +714,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -723,7 +723,7 @@ "' ***----hello---******* '" ] }, - "execution_count": 27, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -741,7 +741,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -767,7 +767,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -807,7 +807,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -833,7 +833,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -852,7 +852,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -877,7 +877,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -901,7 +901,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -918,7 +918,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -935,6 +935,24 @@ ] }, { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'One': 1, 'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5}\n" + ] + } + ], + "source": [ + "d3 = {names[i]:numbers[i] for i in range(len(names))}\n", + "print(d3)" + ] + }, + { "cell_type": "markdown", "metadata": {}, "source": [ @@ -979,22 +997,19 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 43, "metadata": {}, "outputs": [ { - "ename": "NameError", - "evalue": "name 'a1' is not defined", - "output_type": "error", - "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[0ma1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclear\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[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mNameError\u001b[0m: name 'a1' is not defined" + "name": "stdout", + "output_type": "stream", + "text": [ + "{}\n" ] } ], "source": [ + "a1 = {1:10, 2:20}\n", "a1.clear()\n", "print(a1)" ] @@ -1026,14 +1041,14 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{'One': 1, 'Four': 4, 'Three': 3, 'Five': 5, 'Two': 2}\n" + "{'One': 1, 'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5}\n" ] } ], @@ -1052,7 +1067,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -1061,7 +1076,7 @@ "dict_values([1, 2, 3, 4, 5])" ] }, - "execution_count": 36, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -1079,7 +1094,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -1088,7 +1103,7 @@ "dict_keys(['One', 'Two', 'Three', 'Four', 'Five'])" ] }, - "execution_count": 37, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -1106,7 +1121,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 49, "metadata": {}, "outputs": [ { @@ -1137,23 +1152,23 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 51, "metadata": {}, "outputs": [ { - "ename": "KeyError", - "evalue": "'Four'", + "ename": "TypeError", + "evalue": "pop expected at least 1 arguments, got 0", "output_type": "error", "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[0ma2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Four'\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 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mKeyError\u001b[0m: 'Four'" + "\u001b[0;31m------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0mTraceback (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[0ma2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\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[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma2\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: pop expected at least 1 arguments, got 0" ] } ], "source": [ - "a2 = a1.pop('Four')\n", + "a2 = a1.pop()\n", "print(a1)\n", "print(a2)" ] diff --git a/0_python/5_Control_Flow.ipynb b/0_python/5_Control_Flow.ipynb index 2109060..7723227 100644 --- a/0_python/5_Control_Flow.ipynb +++ b/0_python/5_Control_Flow.ipynb @@ -25,7 +25,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -194,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -273,7 +273,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -321,7 +321,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { diff --git a/0_python/6_Function.ipynb b/0_python/6_Function.ipynb index ea80f1f..dc07c1c 100644 --- a/0_python/6_Function.ipynb +++ b/0_python/6_Function.ipynb @@ -275,7 +275,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -300,7 +300,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -321,7 +321,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -337,7 +337,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -346,7 +346,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -367,7 +367,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -385,7 +385,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -420,12 +420,12 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ - "def implicitadd(x,y=3):\n", - " return x+y" + "def implicitadd(x,addnumber=3):\n", + " return x+addnumber" ] }, { @@ -444,7 +444,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 26, "metadata": {}, "outputs": [ { @@ -453,7 +453,7 @@ "7" ] }, - "execution_count": 23, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -471,7 +471,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -480,7 +480,7 @@ "8" ] }, - "execution_count": 24, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -491,7 +491,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -500,13 +500,13 @@ "11" ] }, - "execution_count": 20, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "implicitadd(5, y=6)" + "implicitadd(5, addnumber=6)" ] }, { @@ -525,7 +525,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -547,7 +547,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -563,7 +563,7 @@ "15" ] }, - "execution_count": 30, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -601,14 +601,14 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[30, 10, 20]\n" + "[10, 20, 30]\n" ] }, { @@ -617,7 +617,7 @@ "60" ] }, - "execution_count": 31, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -650,7 +650,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -666,7 +666,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 48, "metadata": {}, "outputs": [], "source": [ @@ -732,7 +732,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -741,7 +741,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -750,7 +750,7 @@ "64" ] }, - "execution_count": 49, + "execution_count": 50, "metadata": {}, "output_type": "execute_result" } @@ -761,7 +761,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -770,7 +770,7 @@ "(6, 8)" ] }, - "execution_count": 27, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -782,7 +782,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -791,7 +791,7 @@ "function" ] }, - "execution_count": 28, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } @@ -802,7 +802,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 53, "metadata": {}, "outputs": [ { @@ -811,7 +811,7 @@ "function" ] }, - "execution_count": 29, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -839,7 +839,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 54, "metadata": {}, "outputs": [], "source": [ @@ -848,7 +848,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 56, "metadata": {}, "outputs": [ { @@ -866,7 +866,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 59, "metadata": {}, "outputs": [ { @@ -891,7 +891,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 60, "metadata": {}, "outputs": [], "source": [ @@ -900,7 +900,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 61, "metadata": {}, "outputs": [ { @@ -925,14 +925,14 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 62, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\n" + "\n" ] } ], @@ -973,7 +973,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 63, "metadata": {}, "outputs": [ { @@ -998,16 +998,16 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 58, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -1025,16 +1025,16 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 65, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 59, + "execution_count": 65, "metadata": {}, "output_type": "execute_result" } diff --git a/0_python/7_Class.ipynb b/0_python/7_Class.ipynb index 817af0a..abab9d7 100644 --- a/0_python/7_Class.ipynb +++ b/0_python/7_Class.ipynb @@ -34,7 +34,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -77,7 +77,7 @@ "__main__.FirstClass" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -88,7 +88,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -97,7 +97,7 @@ "type" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -131,7 +131,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -139,9 +139,9 @@ "evalue": "'FirstClass' object has no attribute 'init'", "output_type": "error", "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[1;32m 1\u001b[0m \u001b[0meg0\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFirstClass\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;32m----> 2\u001b[0;31m \u001b[0meg0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\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;31m------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0mTraceback (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[0meg0\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFirstClass\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;32m----> 2\u001b[0;31m \u001b[0meg0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\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;31mAttributeError\u001b[0m: 'FirstClass' object has no attribute 'init'" ] } @@ -169,7 +169,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -200,7 +200,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -228,7 +228,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": { "scrolled": false }, @@ -265,7 +265,7 @@ " 'class_var']" ] }, - "execution_count": 14, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -276,7 +276,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -285,7 +285,7 @@ "'My first class'" ] }, - "execution_count": 10, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -303,7 +303,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -321,6 +321,7 @@ " '__gt__',\n", " '__hash__',\n", " '__init__',\n", + " '__init_subclass__',\n", " '__le__',\n", " '__lt__',\n", " '__module__',\n", @@ -334,11 +335,12 @@ " '__str__',\n", " '__subclasshook__',\n", " '__weakref__',\n", + " 'class_var',\n", " 'name',\n", " 'symbol']" ] }, - "execution_count": 25, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -356,7 +358,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -375,7 +377,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -385,7 +387,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -393,9 +395,9 @@ "evalue": "'FirstClass' object has no attribute 'name'", "output_type": "error", "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[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\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 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31m------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0mTraceback (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[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\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 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mAttributeError\u001b[0m: 'FirstClass' object has no attribute 'name'" ] } @@ -414,7 +416,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -450,7 +452,7 @@ " 's']" ] }, - "execution_count": 18, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -461,7 +463,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -493,7 +495,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -632,7 +634,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -652,7 +654,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -790,7 +792,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -805,7 +807,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -814,7 +816,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -831,7 +833,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -866,7 +868,7 @@ " 'salary']" ] }, - "execution_count": 38, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -884,7 +886,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 40, "metadata": {}, "outputs": [], "source": [ @@ -902,7 +904,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ @@ -911,7 +913,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -930,7 +932,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -966,7 +968,7 @@ " 'salary']" ] }, - "execution_count": 42, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -996,7 +998,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -1005,7 +1007,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -1041,7 +1043,7 @@ " 'salary']" ] }, - "execution_count": 46, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -1052,7 +1054,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -1078,7 +1080,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ @@ -1094,7 +1096,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ @@ -1103,7 +1105,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -1130,7 +1132,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 53, "metadata": {}, "outputs": [], "source": [ @@ -1147,7 +1149,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 54, "metadata": {}, "outputs": [], "source": [ @@ -1156,7 +1158,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 55, "metadata": {}, "outputs": [ { @@ -1181,7 +1183,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 56, "metadata": {}, "outputs": [ { @@ -1199,7 +1201,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -1224,7 +1226,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ diff --git a/README.md b/README.md index 3219f82..43d6323 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ 由于**本课程需要大量的编程练习才能取得比较好的学习效果**,因此需要认真去完成[《机器学习-作业和报告》](https://gitee.com/pi-lab/machinelearning_homework),写作业的过程可以查阅网上的资料,但是不能直接照抄,需要自己独立思考并独立写出代码。 +为了让大家更好的自学本课程,课程讲座的视频会陆续上传到[b站 - 机器学习](https://space.bilibili.com/421445744/channel/detail?cid=150380),欢迎大家观看学习。 + ![Machine Learning Cover](images/machine_learning.png)