From 92eea2096125ac046c42d08d84f2993e283e9129 Mon Sep 17 00:00:00 2001 From: Michel Schwab <michel.schwab@hu-berlin.de> Date: Mon, 5 Nov 2018 11:28:40 +0100 Subject: [PATCH] =?UTF-8?q?Anmerkungen=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notebooks/anmerkungenUndTipps.ipynb | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/notebooks/anmerkungenUndTipps.ipynb b/notebooks/anmerkungenUndTipps.ipynb index b3e32d7..3979540 100644 --- a/notebooks/anmerkungenUndTipps.ipynb +++ b/notebooks/anmerkungenUndTipps.ipynb @@ -193,7 +193,35 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "- Kommazahlen immer mit \".\" angeben -> 29.99 statt 29,99" + "- Gleitkommazahlen (floats) immer mit \".\" statt \",\" angeben -> 29.99 statt 29,99" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#Gleitkommazahl durch Punkt getrennt -> RICHTIG\n", + "\n", + "preis=29.99\n", + "print(preis)\n", + "print(type(preis))\n", + "# python erkennt die Zahl und gibt die Zahl wieder. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Gleitkommazahl durch Komma getrennt -> FALSCH\n", + "\n", + "preis=29,99\n", + "print(preis)\n", + "type(preis)\n", + "# Python erkennt zwei Zahlen, die es in einem Tupel speichert." ] }, { -- GitLab