Get startedGet started for free

Writing function documentation with pyment II

Documentation helps your users learn how to use your functions, and can even help remind you how to use them.

In this exercise, you'll fill out your NumPy style documentation template to make some beautiful documentation.

Please refer to the previous video and this document about writing documentation in NumPy style.

This exercise is part of the course

Developing Python Packages

View Course

Exercise instructions

  • In the text editor, complete the documentation for the inches_to_feet() function. The short description for this function should read "Convert lengths between inches and feet."
  • Complete the x parameter documentation with type numpy.ndarray and description "Lengths in feet."
  • Complete the reverse parameter documentation with type bool, optional and the description "If true this function converts from feet to inches instead of the default behavior of inches to feet. (Default value = False)".
  • Set the return type to numpy.ndarray.

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise