Search This Blog

Sunday, March 16, 2014

Documentation Strings

Everything between the triple quotes is the function's docstring, which documents what the function does.

A docstring must be the first thing defined in a function (on the next line after the function declaration).

The docstring is available at runtime as an attribute of the function (.__doc__)

""" This is how you declare a doc string.
This even goes to multiple lines.
The docstring ends here. It even ends with a triplequote"""

No comments:

Post a Comment