Docstrings
The document string is a string of multiple lines, where the first line begins with a capital letter and ends with a period. The second behavior is a blank line, followed by a third line beginning with any detailed explanation .
It is strongly recommended that you follow this convention in the documentation string for all your extraordinary features. We can get the document string property of the function Print_max by using the function's __doc__ (note the double-down route) property (which belongs to the function's name).
Just remember that Python treats everything as an object, which naturally includes functions. We'll discuss more details about the object in the Class section later. + If you've ever used Python's help () function, you should already know the purpose of the document string. What it does is get the __doc__ property of the function and present it to you in a neat way.
。 You can try it in the function above-just include help (Print_max) in the program. Remember that you can exit help by pressing the Q key. Automation tools can retrieve documents in your program in this way. Therefore, I strongly recommend that you write all the extraordinary functions for you with a document string.
The Pydoc command included with your Python release is similar to help () using a document string.
A concise tutorial for Python