Docstring

A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition. Such a docstring becomes the __doc__ special attribute of that object. For consistency, always use """triple double quotes""" around docstrings.

def function(parameter):
    """This docstring documents the function, describes the parameter requirements, etc."""
    pass

print(function.__doc__)



Output:

This docstring documents the function, describes the parameter requirements, etc.

results matching ""

    No results matching ""