From 955053c313137211a6da93616511816557e251e2 Mon Sep 17 00:00:00 2001 From: Xanthron Writer Date: Mon, 29 May 2023 12:12:59 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Weitere=20Aufgabe=20f=C3=BCr=20=C3=9Cbung?= =?UTF-8?q?=20Variablen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ich habe eine Weitere Aufgabe für die Übung Variablen erstellt. Ich denke sie passt besser als Einführung da hier vollkommen der Fokus auf die Variablenzuweisung liegt. --- .../02_python/03_variablen/variablen.ipynb | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/book/content/Exercises/02_python/03_variablen/variablen.ipynb b/book/content/Exercises/02_python/03_variablen/variablen.ipynb index af3d19d9..af865183 100644 --- a/book/content/Exercises/02_python/03_variablen/variablen.ipynb +++ b/book/content/Exercises/02_python/03_variablen/variablen.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,13 +41,47 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "## Aufgabenteil A" + "## Aufgabenteil A\n", + "Erstellen Sie zwei Variablen und weisen sie ihnen einen Wert zu. Lassen Sie die Werte ausgeben und tauschen Sie danach die Werte der Variablen. Geben Sie erneut die Werte aus." ] }, { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "loesung", + "hide-cell" + ] + }, + "outputs": [], + "source": [ + "a = 7\n", + "b = 3\n", + "\n", + "print(\"Der Wert von a ist\", a, \"und der Wert von b ist\", b)\n", + "\n", + "temp = a\n", + "a = b\n", + "b = temp\n", + "\n", + "print(\"Der Wert von a ist\", a, \"und der Wert von b ist\", b)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Aufgabenteil B" + ] + }, + { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -58,6 +95,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [ @@ -118,13 +156,15 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "## Aufgabenteil B" + "## Aufgabenteil C" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -146,6 +186,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [ From cec16a60c26a8d14680bab7fefbf419f3b065da7 Mon Sep 17 00:00:00 2001 From: Xanthron Writer Date: Mon, 29 May 2023 12:43:48 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Markdown=20Zelle=20L=C3=B6sungsvorschlag=20?= =?UTF-8?q?erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exercises/02_python/03_variablen/variablen.ipynb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/book/content/Exercises/02_python/03_variablen/variablen.ipynb b/book/content/Exercises/02_python/03_variablen/variablen.ipynb index af865183..3c85df33 100644 --- a/book/content/Exercises/02_python/03_variablen/variablen.ipynb +++ b/book/content/Exercises/02_python/03_variablen/variablen.ipynb @@ -49,6 +49,14 @@ "Erstellen Sie zwei Variablen und weisen sie ihnen einen Wert zu. Lassen Sie die Werte ausgeben und tauschen Sie danach die Werte der Variablen. Geben Sie erneut die Werte aus." ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Lösungsvorschlag" + ] + }, { "cell_type": "code", "execution_count": null,