diff --git a/lectures/python_fundamentals/functions.md b/lectures/python_fundamentals/functions.md index caaf126c..9400b5f0 100644 --- a/lectures/python_fundamentals/functions.md +++ b/lectures/python_fundamentals/functions.md @@ -654,7 +654,6 @@ b = A(3, 4) a == b ``` -Tell people how to see the `type`: You can see that `a` and `b` are both instances of the `A` class by using the `type` function. ```{code-cell} python diff --git a/lectures/scientific/randomness.md b/lectures/scientific/randomness.md index 56f33268..cc5172a9 100644 --- a/lectures/scientific/randomness.md +++ b/lectures/scientific/randomness.md @@ -275,7 +275,7 @@ For more information see the ### Aside: Using Class to Hold Parameters -We have been using objects and classes both internal to python (e.g. `list`) from external libraries (e.g. `numpy.array`). Sometimes it is convenient to create your own classes to organize parameter, data, and functions. +We have been using objects and classes both internal to python (e.g. `list`) from external libraries (e.g. `numpy.array`). Sometimes it is convenient to create your own classes to organize parameter, data, and functions. In this section we will reimplement our function using new classes to hold parameters. @@ -374,7 +374,7 @@ print(params2) print(np.mean(simulate_loan_repayments_2(N, params2))) ``` -The `@dataclass` is an example of a python decorator (see [documentation](https://docs.python.org/3/glossary.html#term-decorator)). Decorators take in a class (or function) and return a new class (or function) with some additional features. In this case, it automatically creates the `__init__` function, allows for default values, and adds a new `__repr__` function which determines how the object is printed. +The `@dataclass` is an example of a python decorator (see [documentation](https://docs.python.org/3/glossary.html#term-decorator)). Decorators take in a class (or function) and return a new class (or function) with some additional features. In this case, it automatically creates the `__init__` function, allows for default values, and adds a new `__repr__` function which determines how the object is printed. #### Profitability Threshold