'Python multiline comments

I am struggling with multi line comments in Python, I understood I can use # at the start of every line of multi line comments but there is also another way of using """ at the start and end of the comment; however, in my interpreter the """ method gives an output instead of ignoring the comment.

>>> """this should
be a multi
line comment"""

And my interpreter gives the following output:

'this should\nbe a multi\nline comment'

Can someone explain it?



Solution 1:[1]

This is very easy to accomplish in python.

# This is a single-line comment

'''
This is a multi-line comment
'''

Just put the comments in ''' and put whatever you want inside of them!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 daniscode1