Refurbish chapter 02

- streamline text
- streamline example functions
- move section on built-ins to beginning
- add notes on the concept of a callable
This commit is contained in:
Alexander Hess 2020-02-05 18:31:52 +01:00
commit 3754297c93
4 changed files with 1639 additions and 715 deletions

View file

@ -67,7 +67,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q3**: What does it mean for a variable to **go out of scope**?"
"**Q3**: What does it mean for a variable to go out of **scope**?"
]
},
{
@ -95,7 +95,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q5**: Explain the concept of **forwarding** a function **call**."
"**Q5**: Explain the concept of **forwarding** a **function call**."
]
},
{
@ -119,6 +119,20 @@
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q7**: What are **callables**? How do they relate to `function` objects?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
@ -137,7 +151,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q7**: A mere function **call** is just an **expression**."
"**Q8**: A mere function **call** is just an **expression**."
]
},
{
@ -151,7 +165,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q8**: When using the `import` statement, we need to ensure that the imported attributes do **not** overwrite any already defined variables and functions."
"**Q9**: When using the `import` statement, we need to ensure that the imported attributes do *not* overwrite any already defined variables and functions."
]
},
{
@ -165,7 +179,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q9:** Functions always have a name by which we can call them."
"**Q10:** Functions always have a name by which we can call them."
]
},
{
@ -179,7 +193,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Q10**: The [standard library](https://docs.python.org/3/library/index.html) is a collection of numerical tools often used in scientific computing, for example, advanced mathematical functions or utilities for simulation."
"**Q11**: The [standard library](https://docs.python.org/3/library/index.html) is a collection of numerical tools often used in scientific computing, for example, advanced mathematical functions or utilities for simulation."
]
},
{