diff --git a/notebooks/beginner/exercises/lists_exercise.ipynb b/notebooks/beginner/exercises/lists_exercise.ipynb index 9c7645b..00db72b 100644 --- a/notebooks/beginner/exercises/lists_exercise.ipynb +++ b/notebooks/beginner/exercises/lists_exercise.ipynb @@ -123,6 +123,89 @@ "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": [ + "print(my_list)\n", + "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": [ + "print(my_list)\n", + "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": [ + "print(my_list)\n", + "assert my_list == []" + ] } ], "metadata": { @@ -141,7 +224,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.4" + "version": "3.7.3" } }, "nbformat": 4, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy