+ 5
Docstrings
It's a little bit confused me ---- Is docstring=multiline comment in Python3? And is docstring different than multiline comment only with it's calling function __doc__?
4 Respuestas
+ 7
Docstrings are multiline comments included inside functions and modules, usually at the beginning of them, to provide information about their purposes/functionalities.
When executing the "help" command on a function, its docstring is shown for the developer to know what it does. Try using the interactive shell to call the "help" command on some functions to inspect their docstrings. 😁
+ 6
I wrote a code snippet to better capture what I was talking about:
https://code.sololearn.com/cjmZy1hUsEow/?ref=app
+ 3
I understand for myself this section of Python like this. Am I right?
comment(multiline comment (docstring))
+ 1
Another name for docstring is multiline strings or comment