Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions 01_materials/slides/02_comments_and_errors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "SyntaxError",
"evalue": "cannot assign to literal here. Maybe you meant '==' instead of '='? (3541004665.py, line 1)",
"output_type": "error",
"traceback": [
" \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31m12 = x\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m cannot assign to literal here. Maybe you meant '==' instead of '='?\n"
]
}
],
"source": [
"12 = x"
]
Expand All @@ -38,9 +47,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (934255472.py, line 1)",
"output_type": "error",
"traceback": [
" \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31m25 -\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax\n"
]
}
],
"source": [
"25 -"
]
Expand All @@ -56,9 +74,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'my_variable' is not defined",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mNameError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[43mmy_variable\u001b[49m + \u001b[32m1\u001b[39m\n",
"\u001b[31mNameError\u001b[39m: name 'my_variable' is not defined"
]
}
],
"source": [
"my_variable + 1"
]
Expand Down Expand Up @@ -137,7 +167,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "python-env (3.11.14)",
"language": "python",
"name": "python3"
},
Expand All @@ -151,7 +181,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.14"
}
},
"nbformat": 4,
Expand Down
Loading