Comments in Python
In Python, comments are preceded by a pound sign (#) on
a line, called a line comment, or enclosed between three consecutive single
quotation marks (''') on one or several lines, called a paragraph comment. When
the Python interpreter sees #, it ignores all text after # on the same line.
When it sees ''', it scans for the next ''' and ignores any text between the
triple quotation marks.
For Example:
# This program displays one message
''' This program displays
Two messages
'''
Line
Continuation Symbol in Python
In some cases, the Python
interpreter cannot determine the end of the statement written in multiple
lines. We can place the line
continuation character (\) at the end of the line to tell the interpreter
that the statement is continued on the next line. For example, the following
statement
fact = 1 * 2 * 3 * 4 *
\
5 * 6
is equivalent to
fact = 1 * 2 * 3 * 4 *
5 * 6