1. Learn
  2. /
  3. Courses
  4. /
  5. Software Engineering Principles in Python

Connected

Exercise

Writing docstrings

We just learned some about the benefits of docstrings. In this exercise, you will practice writing docstrings that can be utilized by a documentation generator like Sphinx.

Note that your docstring submission must match the solution exactly. If you find yourself getting it wrong several times, it may be a good idea to refresh the sample code and start over.

Instructions

100 XP
  • Complete the portions of the docstring that document the parameters.
  • Complete the portion of the docstring describing the return value.
  • Complete the example function usage in the docstring.