build based on e6474b1

This commit is contained in:
Documenter.jl
2024-08-19 14:07:02 +00:00
parent 96c390a5bf
commit b69d0e7340
58 changed files with 16359 additions and 1840 deletions

View File

@@ -147,6 +147,44 @@
"foo()"
]
},
{
"cell_type": "markdown",
"id": "d18e679d",
"metadata": {},
"source": [
"### A very easy first exercise\n",
"\n",
"Run the following cell. It contains definitions used later in the notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "81678b3d",
"metadata": {},
"outputs": [],
"source": [
"function why_q1()\n",
" msg = \"\"\"\n",
" In the first line, we assign a variable to a value. In the second line, we assign another variable to the same value. Thus, we have 2 variables associated with the same value. In line 3, we associate y to a new value (re-assignment). Thus, we have 2 variables associated with 2 different values. Variable x is still associated with its original value. Thus, the value at the final line is x=1.\n",
" \"\"\"\n",
" println(msg)\n",
"end\n",
"function why_q2()\n",
" msg = \"\"\"\n",
" It will be 1 for very similar reasons as in the previous questions: we are reassigning a local variable, not the global variable defined outside the function.\n",
" \"\"\"\n",
" println(msg)\n",
"end\n",
"function why_q3()\n",
" msg = \"\"\"\n",
" It will be 6. In the returned function f2, x is equal to 2. Thus, when calling f2(3) we compute 2*3.\n",
" \"\"\"\n",
" println(msg)\n",
"end\n",
"println(\"🥳 Well done! \")"
]
},
{
"cell_type": "markdown",
"id": "92112bd1",
@@ -467,6 +505,24 @@
"x"
]
},
{
"cell_type": "markdown",
"id": "a2f94960",
"metadata": {},
"source": [
"Run next cell to get an explanation of this question."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fc562337",
"metadata": {},
"outputs": [],
"source": [
"why_q1()"
]
},
{
"cell_type": "markdown",
"id": "4d2cb752",
@@ -586,6 +642,24 @@
"x"
]
},
{
"cell_type": "markdown",
"id": "f69108c2",
"metadata": {},
"source": [
"Run next cell to get an explanation of this question."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "05c62aa3",
"metadata": {},
"outputs": [],
"source": [
"why_q2()"
]
},
{
"cell_type": "markdown",
"id": "4fc5eb9b",
@@ -1068,6 +1142,24 @@
"x"
]
},
{
"cell_type": "markdown",
"id": "062ff145",
"metadata": {},
"source": [
"Run next cell to get an explanation of this question."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6bf7818e",
"metadata": {},
"outputs": [],
"source": [
"why_q3()"
]
},
{
"cell_type": "markdown",
"id": "bc8e9bcf",
@@ -1649,15 +1741,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.0",
"display_name": "Julia 1.10.0",
"language": "julia",
"name": "julia-1.9"
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.0"
"version": "1.10.0"
}
},
"nbformat": 4,