Everywhere I look tells me that a multiline comment can be created as:
'''
This is a multiline
comment.
'''
(see eg this answer, and many more).
However, when I execute this in a python or ipython terminal I see my multiline 'comment' printed.
>>> '''
... This is a multiline
... comment.
... '''
'\nThis is a multiline\ncomment.\n'
>>>
This was not the behaviour I expected. I was led to believe the above code was equivalent to using hashes to denote comments:
>>> # This is also a multiline
... # comment.
...
>>>
which, as I expected, doesn't print anything at all.
So what gives here? Everywhere is telling me I can create multiline comments with the '''
or """
syntax. But, when I'm working directly in a terminal, I don't observe this supposed behaviour.
Is the behaviour in my first example because my comment was interpreted to be a docstring and was therefore printed?