Closed reshnashrestha closed 12 months ago
Here is an example of docstrings from Bard:
def my_function(x, y):
"""This function adds two numbers together.
Args:
x: The first number.
y: The second number.
Returns:
The sum of x and y.
"""
return x + y
Its a nice example of use of docstring in documentation. Thanks @JustinJaniszewski
I was curious about docstring and found this : Docstrings, short for "documentation strings," are a specific type of string literal used in computer programming, particularly in languages like Python. They serve the purpose of providing documentation and information about modules, classes, functions, or methods within your code. Docstrings are typically enclosed in triple-quotes (either single or double) and are placed at the beginning of a module, class, function, or method definition. Source: Chatgpt