Skip to content

Commit c8a96ad

Browse files
Use code cells for solutions
1 parent 0c8e361 commit c8a96ad

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

_solved/python_intro/00-jupyterlab.ipynb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,22 @@
271271
]
272272
},
273273
{
274-
"cell_type": "markdown",
274+
"cell_type": "code",
275+
"execution_count": 1,
275276
"metadata": {
276277
"tags": [
277278
"nbtutor-solution"
278279
]
279280
},
281+
"outputs": [
282+
{
283+
"name": "stdout",
284+
"output_type": "stream",
285+
"text": [
286+
"54\n"
287+
]
288+
}
289+
],
280290
"source": [
281291
"x = 6 * 7 + 12\n",
282292
"print(x)"

_solved/python_intro/02-functions-use.ipynb

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,8 @@
899899
]
900900
},
901901
{
902-
"cell_type": "markdown",
902+
"cell_type": "code",
903+
"execution_count": 2,
903904
"metadata": {
904905
"editable": true,
905906
"slideshow": {
@@ -909,8 +910,26 @@
909910
"nbtutor-solution"
910911
]
911912
},
913+
"outputs": [
914+
{
915+
"name": "stdout",
916+
"output_type": "stream",
917+
"text": [
918+
"\n",
919+
"Order of operations:\n",
920+
"- 1.1 * radiance = 1.1\n",
921+
"- 1.1 - 0.5 = 0.6\n",
922+
"- min(radiance, 0.6) = 0.6\n",
923+
"- 2.0 + 0.6 = 2.6\n",
924+
"- max(2.1, 2.6) = 2.6\n",
925+
"\n",
926+
"At the end, result = 2.6\n",
927+
"\n"
928+
]
929+
}
930+
],
912931
"source": [
913-
"```\n",
932+
"print(\"\"\"\n",
914933
"Order of operations:\n",
915934
"- 1.1 * radiance = 1.1\n",
916935
"- 1.1 - 0.5 = 0.6\n",
@@ -919,7 +938,7 @@
919938
"- max(2.1, 2.6) = 2.6\n",
920939
"\n",
921940
"At the end, result = 2.6\n",
922-
"```"
941+
"\"\"\")"
923942
]
924943
},
925944
{

notebooks/python_intro/00-jupyterlab.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
"name": "python",
330330
"nbconvert_exporter": "python",
331331
"pygments_lexer": "ipython3",
332-
"version": "3.11.8"
332+
"version": "3.8.16"
333333
},
334334
"nav_menu": {},
335335
"toc": {

notebooks/python_intro/02-functions-use.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,8 @@
695695
]
696696
},
697697
{
698-
"cell_type": "markdown",
698+
"cell_type": "code",
699+
"execution_count": null,
699700
"metadata": {
700701
"editable": true,
701702
"slideshow": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```
1+
print("""
22
Order of operations:
33
- 1.1 * radiance = 1.1
44
- 1.1 - 0.5 = 0.6
@@ -7,4 +7,4 @@
77
- max(2.1, 2.6) = 2.6
88
99
At the end, result = 2.6
10-
```
10+
""")

0 commit comments

Comments
 (0)