Skip to content

Commit 74b5578

Browse files
committed
Update Python_walkthrough.ipynb
1 parent 8c2436d commit 74b5578

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

notebooks/Python_walkthrough.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@
717717
"name": "stdout",
718718
"output_type": "stream",
719719
"text": [
720-
"['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'lcm', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'nextafter', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc', 'ulp']\n"
720+
"['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'comb', 'copysign', 'cos', 'cosh', 'degrees', 'dist', 'e', 'erf', 'erfc', 'exp', 'exp2', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'isqrt', 'lcm', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'nextafter', 'perm', 'pi', 'pow', 'prod', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc', 'ulp']\n"
721721
]
722722
}
723723
],
@@ -1617,9 +1617,9 @@
16171617
"cell_type": "markdown",
16181618
"metadata": {},
16191619
"source": [
1620-
"## Use the ``SimpleNamespace`` method to store related variables (and keep things tidy)\n",
1620+
"## Use ``SimpleNamespace`` to store related variables (and keep things tidy)\n",
16211621
"\n",
1622-
"Python ``SimpleNamespace`` method provides an easy way to store related variables and keep things tidy without the need of using a Python dictionary or generate a very large number of variables in the scope. ``SimpleNamespace`` has the advantage over Python dictionaries of accessing the values using the \"dot\" notation, this is using the syntax ``varname.attribute`` instead of ``varname['attribute']``.\n",
1622+
"Python ``SimpleNamespace`` method provides an easy way to store related variables and keep things tidy without the need of using a Python dictionary or generate a very large number of variables in the scope. The main practical difference between ``SimpleNamespace`` and Python dictionaries is that for ``SimpleNamespace`` objects we access the fields using the \"dot\" notation, this is using the syntax ``varname.attribute`` instead of ``varname['attribute']``.\n",
16231623
"\n",
16241624
"For example, imagine that we want to set a threesome of coordinates. In this case, instead of generating three different variables, it would be more convenient to use a single name called ``coordinates`` containing the different values of the coordinates within that _object_ called ``coordinates`` as follows"
16251625
]
@@ -2024,7 +2024,7 @@
20242024
"source": [
20252025
"# Python functions\n",
20262026
"\n",
2027-
"A **function** in Python is a self-contained block of code that encapsulates a specific task or group of related tasks. We have already used several built-in Python functions in this notebook, e.g. ``print()``, or functions belonging to different modules such as ``math.log()``. Python allows the user to define their own functions. For this, first use the keyword ``def`` (meaning _define_) followed by the **name of the function**, a tuple which may be empty or contain one or multiple **arguments** or **parameters** of the function, and a colon. Below this, goes the (indented) code block that do the task(s) as follows\n",
2027+
"A **function** in Python is a compact self-contained block of code that executes some action (preferably) or group of actions. We have already used several built-in Python functions in this notebook, e.g. ``print()``, or functions belonging to different modules such as ``math.log()``. Python allows the user to define their own functions. For this, first use the keyword ``def`` (meaning _define_) followed by the **name of the function**, a tuple which may be empty or contain one or multiple **arguments** or **parameters** of the function, and a colon. Below this, goes the (indented) code block that do the task(s) as follows\n",
20282028
"\n",
20292029
"```python\n",
20302030
"def function_name(\"sequence of parameters if any\"):\n",
@@ -2373,8 +2373,8 @@
23732373
"name": "stdout",
23742374
"output_type": "stream",
23752375
"text": [
2376-
"Notebook tested in 2024-01-09 using:\n",
2377-
"Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:15:57) [MSC v.1916 64 bit (AMD64)]\n"
2376+
"Notebook tested in 2024-02-20 using:\n",
2377+
"Python 3.11.5 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:16:22) [MSC v.1916 64 bit (AMD64)]\n"
23782378
]
23792379
}
23802380
],
@@ -2407,7 +2407,7 @@
24072407
"name": "python",
24082408
"nbconvert_exporter": "python",
24092409
"pygments_lexer": "ipython3",
2410-
"version": "3.10.13"
2410+
"version": "3.11.5"
24112411
}
24122412
},
24132413
"nbformat": 4,

0 commit comments

Comments
 (0)