diff --git a/book/content/Exercises/02_python/03_variablen/variablen.ipynb b/book/content/Exercises/02_python/03_variablen/variablen.ipynb index af3d19d9..3c85df33 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,55 @@ ] }, { + "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." ] }, { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Lösungsvorschlag" + ] + }, + { + "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 +103,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [ @@ -118,13 +164,15 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "## Aufgabenteil B" + "## Aufgabenteil C" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -146,6 +194,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": { "tags": [