Python Syntax im Jupyter Format
Python Syntax im Jupyter Format
This commit is contained in:
parent
a6d510ae5c
commit
568cc4eb8d
@ -4,14 +4,23 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# 1. Phyton Grundlagen"
|
||||
"# Python Syntax\n",
|
||||
"Hinweise zum Lesen:\n",
|
||||
" - Nach dem Code-Block ist jeweils die Konsolen-Ausgabe sichtbar"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Zahlen"
|
||||
"# 1. Grundlagen"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Grundrechenarten und Regeln"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -23,20 +32,35 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"1\n"
|
||||
"9\n",
|
||||
"1\n",
|
||||
"20\n",
|
||||
"1.25\n",
|
||||
"625\n",
|
||||
"1\n",
|
||||
"1\n",
|
||||
"27\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# mit print() wird die Konsolenausgabe realisiert\n",
|
||||
"print(1) # Zahlen können ohne Markup eingefügt werden"
|
||||
"print(5 + 4) # Addition\n",
|
||||
"print(5 - 4) # Subtraktion\n",
|
||||
"print(5 * 4) # Multiplikation\n",
|
||||
"print(5 / 4) # Division\n",
|
||||
"print(5 ** 4)# Exponent\n",
|
||||
"print(5 % 4) # Modulus/Remaider\n",
|
||||
"print(5 // 4)# Integer division\n",
|
||||
"print((5 + 4) *3) #Punkt vor Strich"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Grundrechenarten"
|
||||
"## Daten Typen\n",
|
||||
"### Zahlen\n",
|
||||
"Bei Zahlen wird zwischen Integers (ganzen Zahlen) und Floating-pint Numbers (Kommazahlen) oder kurz Floats unterschieden."
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -48,50 +72,14 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"9\n",
|
||||
"1\n",
|
||||
"20\n",
|
||||
"1.25\n",
|
||||
"27\n"
|
||||
"1.5\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(5 + 4) # Addition\n",
|
||||
"print(5 - 4) # Subtraktion\n",
|
||||
"print(5 * 4) # Multiplikation\n",
|
||||
"print(5 / 4) # Division\n",
|
||||
"print((5 + 4) *3) #Punkt vor Strich"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Variablen"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"5\n",
|
||||
"11\n",
|
||||
"16\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"a = 5 # Einfache Variable\n",
|
||||
"print(a)\n",
|
||||
"b = 5 + 6 # Zahlen können in Variablen verrechnet werden\n",
|
||||
"print(b)\n",
|
||||
"print(a + b) # Variablen können verrechnet werden"
|
||||
"print(1) # Zahlen können ohne Markup eingefügt werden\n",
|
||||
"print(1.5) # Kommata werden anstatt mit ',' mit einem '.' geschrieben"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -104,7 +92,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -127,12 +115,12 @@
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Strings zusammenführen\n",
|
||||
"Mehrere Strings können durch **+** zusammengefügt werden"
|
||||
"Mehrere Strings können durch **+** oder **Leerzeichen** zusammengefügt werden"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
@ -141,12 +129,39 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Mein Name istAlex. Wie ist dein Name?\n"
|
||||
"Mein Name ist Alex. Wie ist dein Name?\n",
|
||||
"Mein Name ist Alex. Wie ist dein Name?\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(\"Mein Name ist\" + name + \". Wie ist dein Name?\")"
|
||||
"print(\"Mein Name ist Alex. \" + \"Wie ist dein Name?\")\n",
|
||||
"print(\"Mein Name ist Alex. \" \"Wie ist dein Name?\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Strings replizieren\n",
|
||||
"Strings können einfach repliziert werden."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"AlexAlexAlexAlexAlex\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(\"Alex\" * 5)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -171,7 +186,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(\"Hallo Welt\"[6:]) #Die ersten 0-6 Zeichen werden übersprungen"
|
||||
"print(\"Hallo Welt!\"[6:-1]) #Die ersten 0-6 Zeichen werden übersprungen"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -191,12 +206,12 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"o\n"
|
||||
"W\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(\"Hallo Welt\"[4]) # der 5. Buchstabe wird ausgegeben"
|
||||
"print(\"Hallo Welt\"[6]) # das 7. Zeichen wird ausgegeben"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -225,6 +240,41 @@
|
||||
"print(b)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Variablen\n",
|
||||
"Variablen können benutzt werden, um Werte zuzuweisen und später einfach aufzurufen.<br>\n",
|
||||
"Für Variablen gelten drei Regeln:\n",
|
||||
" - nur ein Wort\n",
|
||||
" - nur Buchstaben, Zahlen und der Underscore (_)\n",
|
||||
" - darf nicht mit einer Zahl beginnen"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"5\n",
|
||||
"11\n",
|
||||
"16\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"a = 5 # Einfache Variable\n",
|
||||
"print(a)\n",
|
||||
"b = 5 + 6 # Zahlen können in Variablen verrechnet werden\n",
|
||||
"print(b)\n",
|
||||
"print(a + b) # Variablen können verrechnet werden"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -235,7 +285,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -252,6 +302,120 @@
|
||||
"print(\"Hello Welt\") # Diese Zeile wird ausgeführt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Grundfunktionen\n",
|
||||
"Python liefert einige Grundfunktionen.\n",
|
||||
"### Print() - Funktion\n",
|
||||
"Mit der **print()**-Funktion können Ausgaben über die Konsole getätigt werden. Die erforderliche Ausgabe wird in den Klammern **()** getätigt. Für Funktionen die in dieser Klammer ausgeführt werden, wird nur das Ergebnis ausgegeben."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"dies ist ein String\n",
|
||||
"1\n",
|
||||
"3\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(\"dies ist ein String\")\n",
|
||||
"print(1) # eine Zahl\n",
|
||||
"print(1 + 2) # eine Rechnung in der Print()-Funktion"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### input Function\n",
|
||||
"Mithilfe der **input()** Funktion können Eingaben über die Konsole an das Programm übergeben werden. Die Eingabe kann in einer Variable gespeichert werden."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Wie ist dein Name?\n",
|
||||
"Alex\n",
|
||||
"Hallo Alex\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print('Wie ist dein Name?') # ask for their name\n",
|
||||
"myName = input() # eine Zeile mit Eingabe wird geöffnet\n",
|
||||
"print('Hallo {}'.format(myName))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### len Function\n",
|
||||
"Berechnet die Länge eines Strings als Integer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"5"
|
||||
]
|
||||
},
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"len('hello')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Strings aus einer Liste zu einem String zusammenfügen\n",
|
||||
"**join()**-Befehl auf einen String: **string.join(liste)**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Alex, Bob, Cedric, Erika\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"students = [\"Alex\", \"Bob\", \"Cedric\", \"Erika\"]\n",
|
||||
"print(\", \".join(students))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -263,7 +427,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -290,7 +454,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -315,7 +479,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 17,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -340,7 +504,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": 18,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -369,7 +533,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": 19,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -394,7 +558,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 20,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -420,7 +584,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": 21,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -445,7 +609,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"execution_count": 22,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -470,7 +634,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"execution_count": 23,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -488,31 +652,6 @@
|
||||
"print(x) #entferntes Element"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Listenlänge abfragen\n",
|
||||
"mit dem **len()**-Befehl kann die Länge einer Liste abgefragt werden"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 19,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"2\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"print(len(students))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -523,7 +662,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": 24,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -544,7 +683,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": 25,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -564,7 +703,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": 26,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -600,7 +739,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 23,
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -638,7 +777,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": 28,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -664,7 +803,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"execution_count": 29,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
@ -692,7 +831,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"execution_count": 30,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -708,32 +847,6 @@
|
||||
"print(age)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Strings aus einer Liste zu einem String zusammenfügen\n",
|
||||
"**join()**-Befehl auf einen String: **string.join(liste)**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Alex, Bob, Cedric, Erika\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"students = [\"Alex\", \"Bob\", \"Cedric\", \"Erika\"]\n",
|
||||
"print(\", \".join(students))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -744,7 +857,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"execution_count": 31,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -769,18 +882,18 @@
|
||||
"# 4. Operatoren\n",
|
||||
"### Vergleichoperatoren\n",
|
||||
"Verschiedene Operatoren zum Vergleichen von Variablen/Zahlen\n",
|
||||
" **a == b** Werte sind gleich\n",
|
||||
" **a != b** Werte sind ungleich\n",
|
||||
" **a < b** Wert b ist größer als Wert a\n",
|
||||
" **a > b** Wert a ist größer als Wert b\n",
|
||||
" **a <= b** Wert b ist größer-gleich Wert a\n",
|
||||
" **a >= b** Wert a ist größer-gleich Wert a\n",
|
||||
" - **a == b** Werte sind gleich\n",
|
||||
" - **a != b** Werte sind ungleich\n",
|
||||
" - **a < b** Wert b ist größer als Wert a\n",
|
||||
" - **a > b** Wert a ist größer als Wert b\n",
|
||||
" - **a <= b** Wert b ist größer-gleich Wert a\n",
|
||||
" - **a >= b** Wert a ist größer-gleich Wert a\n",
|
||||
"Die Ausgabe über **print()** gibt die Booleans **True**(Wahr) oder **False**(Falsch) aus"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 29,
|
||||
"execution_count": 32,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -788,9 +901,11 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"False\n",
|
||||
"True\n",
|
||||
"True\n",
|
||||
"False\n",
|
||||
"True\n",
|
||||
"True\n",
|
||||
"False\n",
|
||||
"False\n",
|
||||
"True\n",
|
||||
"False\n"
|
||||
@ -800,13 +915,15 @@
|
||||
"source": [
|
||||
"a = 5\n",
|
||||
"b = 6\n",
|
||||
"print(a == b)\n",
|
||||
"print(a == b) # Gleichheit\n",
|
||||
"print(a != b) # Ungleichheit\n",
|
||||
"print(a < b) # kleiner als\n",
|
||||
"print(a > b) # größer als\n",
|
||||
"print(a <= b) # kleiner-gleich als\n",
|
||||
"print(a >= b) # größer-gleich als\n",
|
||||
"print( \"Hallo\" == \"World\") # auch Strings können verglichen werden\n",
|
||||
"print(a != b)\n",
|
||||
"print(a < b) \n",
|
||||
"print(a > b)\n",
|
||||
"print(a <= b)\n",
|
||||
"print(a >= b)"
|
||||
"print(True is True) # für Boolean Werte keine '='-Zeichen benutzen!\n",
|
||||
"print(True is not True) # Boolean werden mit 'is' und 'is not' abgefragt"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -818,7 +935,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 30,
|
||||
"execution_count": 33,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -842,7 +959,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"execution_count": 34,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -864,6 +981,26 @@
|
||||
"print(False or False)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"False\n",
|
||||
"True\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# 'not' Gatter negieren Ihr Ergebnis\n",
|
||||
"print(not True)\n",
|
||||
"print(not False)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -876,7 +1013,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"execution_count": 36,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -903,7 +1040,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 33,
|
||||
"execution_count": 37,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -931,7 +1068,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 34,
|
||||
"execution_count": 38,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -960,7 +1097,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": 39,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1008,7 +1145,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 36,
|
||||
"execution_count": 40,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1038,7 +1175,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"execution_count": 41,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1073,7 +1210,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 38,
|
||||
"execution_count": 42,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1109,7 +1246,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"execution_count": 43,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1140,7 +1277,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 40,
|
||||
"execution_count": 44,
|
||||
"metadata": {
|
||||
"scrolled": true
|
||||
},
|
||||
@ -1172,7 +1309,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 41,
|
||||
"execution_count": 45,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1194,7 +1331,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 42,
|
||||
"execution_count": 46,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1229,7 +1366,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 43,
|
||||
"execution_count": 47,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1260,7 +1397,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 44,
|
||||
"execution_count": 48,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1280,7 +1417,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 45,
|
||||
"execution_count": 49,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1310,7 +1447,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 46,
|
||||
"execution_count": 50,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1345,7 +1482,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 47,
|
||||
"execution_count": 51,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1395,7 +1532,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 48,
|
||||
"execution_count": 52,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -1414,7 +1551,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 49,
|
||||
"execution_count": 53,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1451,7 +1588,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 50,
|
||||
"execution_count": 54,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1484,7 +1621,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 51,
|
||||
"execution_count": 55,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1511,7 +1648,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 52,
|
||||
"execution_count": 56,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1540,7 +1677,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 53,
|
||||
"execution_count": 57,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1568,7 +1705,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 54,
|
||||
"execution_count": 58,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1594,7 +1731,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 55,
|
||||
"execution_count": 59,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1626,7 +1763,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 56,
|
||||
"execution_count": 60,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1649,6 +1786,24 @@
|
||||
"plt.show()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### Programm Beenden/Abbrechen\n",
|
||||
"Mit **sys.exit** (muss importiert werden) kann ein laufendes Programm vorzeitig abgebrochen werden."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 61,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import sys\n",
|
||||
"#sys.exit() (Bei Anwendung hier kann der weitere Verlauf nicht umgesetzt werden)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
@ -1659,7 +1814,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 57,
|
||||
"execution_count": 62,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1683,7 +1838,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 58,
|
||||
"execution_count": 63,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1716,7 +1871,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 59,
|
||||
"execution_count": 64,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1740,7 +1895,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 60,
|
||||
"execution_count": 65,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1783,7 +1938,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 61,
|
||||
"execution_count": 66,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -1809,7 +1964,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 62,
|
||||
"execution_count": 67,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -1835,7 +1990,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 63,
|
||||
"execution_count": 68,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1862,7 +2017,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 64,
|
||||
"execution_count": 69,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -1908,7 +2063,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 65,
|
||||
"execution_count": 70,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user