0
how to print multiple docstring with in a function
def shout(word): """ Print a word with an exclamation mark following it. """ print(word + "!") """ this section is not prinfed why? """ shout("spam") print (shout.__doc__) this is the code and second comment is not printed
1 Respuesta
+ 1
You might want to look at this, as a validator (that may answer your question) and doc reference.
http://dolphm.com/pep257-good-JUMP_LINK__&&__python__&&__JUMP_LINK-docstrings-by-example/amp/
Even though the Python docs (in the related PEP's) show what you're trying to do, the apparently strict definition is that they're supposed to be at line 1 in the local scope. People generally say not to get too clever with them.