Functions

Concepts

  • function: definition and call

  • formal and actual parameters, local variables

  • name space, scope

  • compound statements: indentation

  • Python modules

  • Python comments

  • docstrings

  • help of a function with docstrings: from the shell and from a script

  • function test with Doctest

  • verbose mode

Keywords

def, return
doctest.testfile('file_name.txt', verbose=True)

Examples

Notes

Slides

References

Exercises