I have this code in python
''' if a:
b = c
'''
is ''' suggesting that this code is just a comment or this will actually execute?
I have this code in python
''' if a:
b = c
'''
is ''' suggesting that this code is just a comment or this will actually execute?
In some cases, when you need to include really long strings (e.g. containing several paragraphs of informational text), it is annoying that you have to terminate each line with \n\, especially if you would like to reformat the text occasionally with a powerful text editor like Emacs. For such situations, ``triple-quoted'' strings can be used, e.g.
Documentation (http://docs.python.org/release/1.4/tut/node70.html)
Triple quotes are also used for docstrings (Documentation),
def my_function():
... """Do nothing, but document it.
...
... No, really, it doesn't do anything.
... """
... pass
...
>>> print my_function.__doc__
Do nothing, but document it.
No, really, it doesn't do anything.
Also take a look at these questions:
It is just a string literal. It uses triple-quoted style so, citing the Python reference:
In triple-quoted strings, unescaped newlines and quotes are allowed (and are retained), except that three unescaped quotes in a row terminate the string. (A “quote” is the character used to open the string, i.e. either ' or ".)
In your case, it seems it is not part of a variable assignment. So it is probably a documentation string or docstring.
It is similar to a comment because is used to document code. It is not executed but evaluated and recognized by the compiler available through __doc__
attribute of class, function or module.