Skip to content

Commit

Permalink
Use code cells for solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Mar 24, 2024
1 parent 0c8e361 commit c8a96ad
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 8 deletions.
12 changes: 11 additions & 1 deletion _solved/python_intro/00-jupyterlab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,22 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": 1,
"metadata": {
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"54\n"
]
}
],
"source": [
"x = 6 * 7 + 12\n",
"print(x)"
Expand Down
25 changes: 22 additions & 3 deletions _solved/python_intro/02-functions-use.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,8 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": 2,
"metadata": {
"editable": true,
"slideshow": {
Expand All @@ -909,8 +910,26 @@
"nbtutor-solution"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Order of operations:\n",
"- 1.1 * radiance = 1.1\n",
"- 1.1 - 0.5 = 0.6\n",
"- min(radiance, 0.6) = 0.6\n",
"- 2.0 + 0.6 = 2.6\n",
"- max(2.1, 2.6) = 2.6\n",
"\n",
"At the end, result = 2.6\n",
"\n"
]
}
],
"source": [
"```\n",
"print(\"\"\"\n",
"Order of operations:\n",
"- 1.1 * radiance = 1.1\n",
"- 1.1 - 0.5 = 0.6\n",
Expand All @@ -919,7 +938,7 @@
"- max(2.1, 2.6) = 2.6\n",
"\n",
"At the end, result = 2.6\n",
"```"
"\"\"\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/python_intro/00-jupyterlab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.8.16"
},
"nav_menu": {},
"toc": {
Expand Down
3 changes: 2 additions & 1 deletion notebooks/python_intro/02-functions-use.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,8 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
Expand Down
4 changes: 2 additions & 2 deletions notebooks/python_intro/_solutions/02-functions-use6.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```
print("""
Order of operations:
- 1.1 * radiance = 1.1
- 1.1 - 0.5 = 0.6
Expand All @@ -7,4 +7,4 @@
- max(2.1, 2.6) = 2.6
At the end, result = 2.6
```
""")

0 comments on commit c8a96ad

Please sign in to comment.