What is Docstring?
A string literal placed as the first statement in a module, class, or function to document its purpose and usage.
Docstrings use triple quotes and describe what code does, its parameters, return values, and examples. They are accessible at runtime via __doc__ attribute and used by help() function, IDE tooltips, and documentation generators.
Common formats include Google style, NumPy style, and reStructuredText (Sphinx). Tools like Sphinx generate beautiful HTML documentation from docstrings. PEP 257 defines docstring conventions.