Re-run Chapter 01 files with Python 3.12

This commit is contained in:
Alexander Hess 2024-04-08 16:03:12 +02:00
parent d6c8a5b8ac
commit 8da18b8677
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
8 changed files with 28 additions and 20 deletions

View file

@ -1654,10 +1654,10 @@
"outputs": [ "outputs": [
{ {
"ename": "SyntaxError", "ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-47-cafa82e54b9c>, line 1)", "evalue": "invalid syntax (73631267.py, line 1)",
"output_type": "error", "output_type": "error",
"traceback": [ "traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-47-cafa82e54b9c>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m 3.99 $ + 10.40 $\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" "\u001b[0;36m Cell \u001b[0;32mIn[47], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m 3.99 $ + 10.40 $\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
] ]
} }
], ],
@ -1687,10 +1687,10 @@
"outputs": [ "outputs": [
{ {
"ename": "SyntaxError", "ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-48-499e4d0d0cbb>, line 1)", "evalue": "expected ':' (2545637715.py, line 1)",
"output_type": "error", "output_type": "error",
"traceback": [ "traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-48-499e4d0d0cbb>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m for number in numbers\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" "\u001b[0;36m Cell \u001b[0;32mIn[48], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m for number in numbers\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m expected ':'\n"
] ]
} }
], ],
@ -1721,10 +1721,10 @@
"outputs": [ "outputs": [
{ {
"ename": "IndentationError", "ename": "IndentationError",
"evalue": "expected an indented block (<ipython-input-49-19398c5f89de>, line 2)", "evalue": "expected an indented block after 'for' statement on line 1 (1544118965.py, line 2)",
"output_type": "error", "output_type": "error",
"traceback": [ "traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-49-19398c5f89de>\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m print(number)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block\n" "\u001b[0;36m Cell \u001b[0;32mIn[49], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m print(number)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block after 'for' statement on line 1\n"
] ]
} }
], ],
@ -1775,7 +1775,7 @@
"traceback": [ "traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", "\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-50-bc757c3fda29>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;36m1\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "Cell \u001b[0;32mIn[50], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;241;43m1\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\n",
"\u001b[0;31mZeroDivisionError\u001b[0m: division by zero" "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
] ]
} }
@ -2156,7 +2156,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"livereveal": { "livereveal": {
"auto_select": "code", "auto_select": "code",

View file

@ -151,7 +151,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"toc": { "toc": {
"base_numbering": 1, "base_numbering": 1,

View file

@ -197,7 +197,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"toc": { "toc": {
"base_numbering": 1, "base_numbering": 1,

View file

@ -350,7 +350,7 @@
"traceback": [ "traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-13-1748287bc46a>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mvariable\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "Cell \u001b[0;32mIn[13], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mvariable\u001b[49m\n",
"\u001b[0;31mNameError\u001b[0m: name 'variable' is not defined" "\u001b[0;31mNameError\u001b[0m: name 'variable' is not defined"
] ]
} }
@ -419,6 +419,7 @@
"text/plain": [ "text/plain": [
"['In',\n", "['In',\n",
" 'Out',\n", " 'Out',\n",
" 'Path',\n",
" '_',\n", " '_',\n",
" '_10',\n", " '_10',\n",
" '_11',\n", " '_11',\n",
@ -435,6 +436,7 @@
" '__loader__',\n", " '__loader__',\n",
" '__name__',\n", " '__name__',\n",
" '__package__',\n", " '__package__',\n",
" '__session__',\n",
" '__spec__',\n", " '__spec__',\n",
" '_dh',\n", " '_dh',\n",
" '_i',\n", " '_i',\n",
@ -457,11 +459,17 @@
" '_ii',\n", " '_ii',\n",
" '_iii',\n", " '_iii',\n",
" '_oh',\n", " '_oh',\n",
" 'atexit',\n",
" 'exit',\n", " 'exit',\n",
" 'get_ipython',\n", " 'get_ipython',\n",
" 'history',\n",
" 'history_path',\n",
" 'open',\n",
" 'os',\n",
" 'quit',\n", " 'quit',\n",
" 'register_readline_completion',\n", " 'readline',\n",
" 'sys']" " 'state_home',\n",
" 'write_history']"
] ]
}, },
"execution_count": 15, "execution_count": 15,
@ -636,10 +644,10 @@
"outputs": [ "outputs": [
{ {
"ename": "SyntaxError", "ename": "SyntaxError",
"evalue": "cannot assign to operator (<ipython-input-23-ec51dae29567>, line 1)", "evalue": "cannot assign to expression here. Maybe you meant '==' instead of '='? (202417111.py, line 1)",
"output_type": "error", "output_type": "error",
"traceback": [ "traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-23-ec51dae29567>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m address@work = \"WHU, Burgplatz 2, Vallendar\"\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m cannot assign to operator\n" "\u001b[0;36m Cell \u001b[0;32mIn[23], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m address@work = \"WHU, Burgplatz 2, Vallendar\"\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m cannot assign to expression here. Maybe you meant '==' instead of '='?\n"
] ]
} }
], ],
@ -1685,7 +1693,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"livereveal": { "livereveal": {
"auto_select": "code", "auto_select": "code",

View file

@ -191,7 +191,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"toc": { "toc": {
"base_numbering": 1, "base_numbering": 1,

View file

@ -110,7 +110,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"livereveal": { "livereveal": {
"auto_select": "code", "auto_select": "code",

View file

@ -194,7 +194,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"toc": { "toc": {
"base_numbering": 1, "base_numbering": 1,

View file

@ -83,7 +83,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.12.2"
}, },
"livereveal": { "livereveal": {
"auto_select": "code", "auto_select": "code",