Understanding how to declare a function and store it inside another variable for later use

You can improve the legibility of your code by using a triple backtick fence:

```
like this
```

If you’re ever uncertain about what a function does, or what arguments you can give it, try pressing ? in a REPL, which will get you to the help-mode. Then write the name of the function, and you will see the docstrings.

In this case, you are defining a function pdfnormalDensity(z) which gives the value at z of the probability density function for a normal distribution.

2 Likes