function stub
An incomplete function whose heading and docstring are written but whose body is left for you to fill in.
In more detail
The course hands out stubs for exercises: the name, parameters and an example in the docstring are given, and the body may be just pass. Writing the stub first is also a good habit, because it forces you to decide what the function takes and returns.
Related terms
- function — A named, reusable block of code that takes inputs, called arguments, and can return a result.
- docstring — A string literal placed as the first statement of a module, function or class, which Python keeps as its documentation.
- pass — A statement that does nothing, used where Python requires a statement but you have nothing to write yet.
Taught in
- Lists, Range And The For Loop — Hands-on Python: Complete Video Course & Book
- Accumulation Loops — Hands-on Python: Complete Video Course & Book
- Mad Libs Revisited: The Whole Program — Hands-on Python: Complete Video Course & Book
- More String Methods — Hands-on Python: Complete Video Course & Book
- Interactive While Loops — Hands-on Python: Complete Video Course & Book