The docstring is a document or explanation of a Python class or function. It makes it easy to understand the functionality of code without having to read the details of implementation.
Example,
The functionality of the below function sum() can easily be understood using the doc string present in “”” triple quotes.
def sum(a, b):     """     Add up two integer numbers.    This function simply adds the two number using the ``+`` operator.     Parameters     ----------     a : int        First number to add.     b : int         Second number to add.     Returns     ------->     int         The sum of ``a`` and ``b``.    Example     --------    >>> sum(2, 3)     5     """     return num1 + num2