Python Docstrings
Python Docstrings Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, and methods. It’s specified in source code that is used, like a comment, to document a specific segment of code. Unlike conventional source code comments, the docstring should describe what the function does, not how. How docstring look like? The doc string line should begin with a capital letter and end with a period. The first line should be a short description. If there are more lines in the documentation string, the second line should be blank, visually separating the summary from the rest of the description. The following lines should be one or more paragraphs describing the object’s calling conventions, its side effects, etc. Doc String can be one liner or multiliner based on requirements with proper indentation . Declaring Docstrings: The docstrings are declared using ”’triple single quotes”’ or “””triple double quotes””” j...
Comments
Post a Comment