A good docstring explains:
What the function does (one line)
What parameters it takes
What it returns
def divide(a, b):
"""
Divide a by b.
Parameters:
a: The dividend
b: The divisor (must not be zero)
Returns:
The result of a / b
"""
return a / b
For simple functions, a one-liner is enough. For complex ones, add details.