Python3> documentation string / docstring

Python 3.5.2 documents

http://docs.python.jp/3/tutorial/controlflow.html#defining-functions

4.6. Define a function ...

>>> def fib(n):    # write Fibonacci series up to n
...     """Print a Fibonacci series up to n."""
...     a, b = 0, 1
...     while a < n:
...         print(a, end=' ')
...         a, b = b, a+b
...     print()
...
>>> # Now call the function we just defined:
... fib(2000)
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597

The first line of the statement in the body of the function can be a string literal. In that case, this string is called the function's documentation string, or docstring. (For more information on docstrings, see Documentation Strings.)

Recommended Posts

Python3> documentation string / docstring
Python string
Python: String concatenation
Python string format
python string slice
Documentation string reconsidered
Python2 string type
Python string format
Python # string type
Python string inversion
String manipulation in python
[Python] Multi-line string assignment
Python string manipulation master
[Python2] Date string-> UnixTime-> Date string
Python string processing illustration
[python] Convert date to string
String object methods in Python
[Python] Use a string sequence
Various Python built-in string operations
[Python 2/3] Parse the format string
About Python string comparison operators
String date manipulation in Python
Python f character (formatted string)
String format with Python% operator
Python
Add Python 2.7 Japanese documentation to Dash.app
String replacement with Python regular expression
6 ways to string objects in Python
Automatically build Python documentation with Sphinx
python documentation reading socket programming HOWTO
python string processing map and lambda
Create a random string in Python
docstring
Write documentation in Sphinx with Python Livereload
Conversion of string <-> date (date, datetime) in Python
Automatically create Python API documentation with Sphinx
Write the test in a python docstring
# 5 [python3] Extract characters from a character string
[Python] Use string data with scikit-learn SVM
python string comparison / use'list'and'in' instead of'==' and'or'
[Python] How to invert a character string
Automatically generate Python Docstring Comment in Emacs
[Python beginner memo] Python character string, path operation
Basic grammar of Python3 system (character string)
[python] EOL while scanning string literal resolution
Generate a class from a string in Python
python> link> remove CR, LF>'test string \ n'.rstrip ()
Python basic course (4 numeric type / character string type)
String → Bool value conversion in Python Consideration
A memorandum of python string deletion process