documentation python provides integrated support for embedding formal documentation directly in source code using mechanism known as docstring formallyany string literal that appears as the first statement within the body of moduleclassor function (including member function of classwill be considered to be docstring by conventionthose string literals should be delimited within triple quotes ("""as an exampleour version of the scale function from page could be documented as followsdef scale(datafactor)"""multiply all entries of numeric data list by the given factor ""for in range(len(data))data[jfactor it is common to use the triple-quoted string delimiter for docstringeven when the string fits on single lineas in the above example more detailed docstrings should begin with single line that summarizes the purposefollowed by blank lineand then further details for examplewe might more clearly document the scale function as followsdef scale(datafactor)"""multiply all entries of numeric data list by the given factor data an instance of any mutable sequence type (such as listcontaining numeric elements factor number that serves as the multiplicative factor for scaling ""for in range(len(data))data[jfactor docstring is stored as field of the modulefunctionor class in which it is declared it serves as documentation and can be retrieved in variety of ways for examplethe command help( )within the python interpreterproduces the documentation associated with the identified object an external tool named pydoc is distributed with python and can be used to generate formal documentation as text or as web page guidelines for authoring useful docstrings are available atin this bookwe will try to present docstrings when space allows omitted docstrings can be found in the online version of our source code