Python LanguageComments and Documentation

Syntax

  • # This is a single line comment
  • print("")  # This is an inline comment
  • """
    This is
    a multi-line comment
    """

Remarks

Developers should follow the PEP257 - Docstring Conventions guidelines. In some cases, style guides (such as Google Style Guide ones) or documentation rendering third-parties (such as Sphinx) may detail additional conventions for docstrings.

Related Examples

Single line, inline and multiline comments