diff --git a/book/content/Exercises/02_python/04_listen/listen.ipynb b/book/content/Exercises/02_python/04_listen/listen.ipynb index 5aee0759..5aae064e 100644 --- a/book/content/Exercises/02_python/04_listen/listen.ipynb +++ b/book/content/Exercises/02_python/04_listen/listen.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [ @@ -24,6 +25,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -31,6 +33,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -38,6 +41,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -45,6 +49,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -61,6 +66,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -68,6 +74,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -87,6 +94,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -151,6 +159,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -158,6 +167,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -172,6 +182,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [ @@ -328,6 +339,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -335,6 +347,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -348,6 +361,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [ @@ -526,6 +540,50 @@ "liste.sort()\n", "print(liste)" ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Aufgabenteil C\n", + "\n", + "Schreiben Sie ein Skript, das eine Liste mit Zahlen von 0 bis 30 ausgibt. Jedoch sollen nur Zahlen nach einem bestimmten Muster in der Liste vorhanden sein. 2 zahlen hinzufügen, danach 3 Zahlen überspringen, danach wieder 2 Zahlen einfügen um darauf die nächsten 3 wieder zu überspringen, usw. bis zur Zahl 30.\n", + "\n", + "Schleifen und Verzweigungen sind erst Teil der nächsten Übungen. Für die Lösung sind nur die Kenntnisse dieser Seite notwendig." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Lösungsvorschlag" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "tags": [ + "loesung", + "hide-cell" + ] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0, 1, 5, 6, 10, 11, 15, 16, 20, 21, 25, 26]\n" + ] + } + ], + "source": [ + "liste = list(range(0,30,5)) + list(range(1,30,5))\n", + "liste.sort()\n", + "print(liste)" + ] } ], "metadata": { @@ -545,7 +603,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.10.10" } }, "nbformat": 4,