A docstring is a multi-line string (written in triple quotes """ """ or ''' ''') that is placed inside a function, class, or module. It describes what the function does.
✅ The answer: It makes your code easier to read, organize, and reuse!
If I was to document my function like this, I would be able to get the output shown below:
Python follows PEP 257 guidelines for writing clean and structured docstrings.
Common styles:
✅ One-liner: For very simple functions.
✅ Multi-line docstring: For more complex functions with parameters and return values.