How can you embed a docstring within a Python function?
- By adding a leading hyphen
- By enclosing in {} braces
- By prefixing with '#'
- By using triple quotes
In Python, docstrings are embedded within functions using triple quotes (''' or """). They provide documentation and can be accessed using .__doc__.
Loading...
Related Quiz
- The ____ attribute in a Matplotlib Axes object represents the y-axis.
- In Python, _____ is a special method used to overload the ‘+’ operator for custom objects.
- When using Scikit-learn, what is the initial step to perform before fitting a model to the dataset?
- To enable database migrations in Flask, the ____ extension can be used.
- Which file mode in Python allows appending to a file in binary format?