From d2948245d5970094de7a0f322c09eb2e20d16a95 Mon Sep 17 00:00:00 2001 From: shivapbhusal Date: Sat, 5 Sep 2020 22:36:02 -0400 Subject: [PATCH 1/2] add additional items to lists exercise --- .../beginner/exercises/lists_exercise.ipynb | 82 ++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/notebooks/beginner/exercises/lists_exercise.ipynb b/notebooks/beginner/exercises/lists_exercise.ipynb index 9c7645b..4aa0c2c 100644 --- a/notebooks/beginner/exercises/lists_exercise.ipynb +++ b/notebooks/beginner/exercises/lists_exercise.ipynb @@ -123,6 +123,86 @@ "print(my_list)\n", "assert my_list == [14, 12, 6.2, 6, 5, 1, 0.9, 0]" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4. Remove items from right " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "my_list = [1, 2, 3]\n", + "my_list.____\n", + "my_list.____" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "assert my_list == [1]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5. Insert an item at a given position" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "my_list = ['I', 'am', 'Python']\n", + "#Let's insert an item after 'am'\n", + "my_list.____(____, ____)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "assert my_list = ['I', 'am', 'learning', 'Python']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6. Remove all items from a list" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "my_list = [1, 2, 3]\n", + "my_list.____" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "assert my_list == []" + ] } ], "metadata": { @@ -141,7 +221,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.4" + "version": "3.7.3" } }, "nbformat": 4, From e4dd87fa08112025cf3d50aa334c99f7b485fe3b Mon Sep 17 00:00:00 2001 From: shivapbhusal Date: Sat, 5 Sep 2020 22:43:29 -0400 Subject: [PATCH 2/2] add print statements --- notebooks/beginner/exercises/lists_exercise.ipynb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notebooks/beginner/exercises/lists_exercise.ipynb b/notebooks/beginner/exercises/lists_exercise.ipynb index 4aa0c2c..00db72b 100644 --- a/notebooks/beginner/exercises/lists_exercise.ipynb +++ b/notebooks/beginner/exercises/lists_exercise.ipynb @@ -148,6 +148,7 @@ "metadata": {}, "outputs": [], "source": [ + "print(my_list)\n", "assert my_list == [1]" ] }, @@ -175,7 +176,8 @@ "metadata": {}, "outputs": [], "source": [ - "assert my_list = ['I', 'am', 'learning', 'Python']" + "print(my_list)\n", + "assert my_list == ['I', 'am', 'learning', 'Python']" ] }, { @@ -201,6 +203,7 @@ "metadata": {}, "outputs": [], "source": [ + "print(my_list)\n", "assert my_list == []" ] }