Python functions
Use these questions as a learning tool. Treat them like a quiz. Answer in your mind, and using the tool, and writing them down. Make it stick!
- Quiz yourself
- How much can you remember without this list (below)?
- What is missing from this list?
- Don’t just go through the posted notes to answer this. First, recall everything you can, and try it out. Then review notes to recall what you missed.
- Develop the “muscle memory” of using the tool
- What is the basic syntax for functions?
- How to use default arguments?
- What is a docstring and how do you type it?
- Global versus local variables?
- T/F: a variable or function has to be defined before it is used not necessarily top to bottom?
- T/F: functions can be passed as arguments to other functions.
- Give an example of why we would do this? (Any time we operate on functions, like taking a derivative…)
- Functions operate on numbers, but can also operate on functions.
- How to return multiple values from a function.
- How to call a function that returns multiple values.
- Can function arguments be used out of order? If so, how?