From 9f7d724a85529aa0d74a523aef2519af61a7d7e9 Mon Sep 17 00:00:00 2001 From: Christof Kaufmann <christof.kaufmann@hs-bochum.de> Date: Wed, 20 Mar 2024 12:06:21 +0000 Subject: [PATCH] Notebooks from applied-cs/data-science@0d9becc1 --- 01-python-grundlagen/01-typ-sol.ipynb | 79 +++++++++++++++++++++++++++ 01-python-grundlagen/01-typ.ipynb | 33 +++++++++++ 2 files changed, 112 insertions(+) create mode 100644 01-python-grundlagen/01-typ-sol.ipynb create mode 100644 01-python-grundlagen/01-typ.ipynb diff --git a/01-python-grundlagen/01-typ-sol.ipynb b/01-python-grundlagen/01-typ-sol.ipynb new file mode 100644 index 0000000..883183d --- /dev/null +++ b/01-python-grundlagen/01-typ-sol.ipynb @@ -0,0 +1,79 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Datentyp ausgeben\n", + "\n", + "Welchen Datentyp haben folgende Werte?\n", + "\n", + "1. `True`\n", + "2. `0j`\n", + "3. `None`\n", + "\n", + "## Lösung\n", + "\n", + "Die Typen lassen sich einfach mit `type` bestimmen:" + ], + "id": "0004-1f61845aa97bff37f25f818467391b497fa5b6fcf087d0e81c71532c275" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "<class 'bool'>" + ] + } + ], + "source": [ + "type(True)" + ], + "id": "0005-df7d7494b32b7cdbd79087a8dd57a4c6c95095e82547c637f4c4bfe485f" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "<class 'complex'>" + ] + } + ], + "source": [ + "type(0j)" + ], + "id": "0006-13b52566f22a279acd63fc57d95091b2493357706bd065d8a727b572611" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "<class 'NoneType'>" + ] + } + ], + "source": [ + "type(None)" + ], + "id": "0007-d581c12814308cfeab9686cf0b8a070a86377c5a2d8a168461e9fb10135" + } + ], + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {} +} diff --git a/01-python-grundlagen/01-typ.ipynb b/01-python-grundlagen/01-typ.ipynb new file mode 100644 index 0000000..c376cc1 --- /dev/null +++ b/01-python-grundlagen/01-typ.ipynb @@ -0,0 +1,33 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Datentyp ausgeben\n", + "\n", + "Welchen Datentyp haben folgende Werte?\n", + "\n", + "1. `True`\n", + "2. `0j`\n", + "3. `None`\n", + "\n", + "Hier Ihr Code:" + ], + "id": "0003-2a798ee28cfcb938800beac0fd4712c3d054f0b3f638832be626b907c00" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "style": "python" + }, + "outputs": [], + "source": [], + "id": "0004-44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ], + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {} +} -- GitLab