How to comment out multiple lines in python?

Comment out multiple lines in python

In Python, you can comment out multiple lines using triple-quotes for multi-line strings. Here’s an example:

"""
This is a
multi-line
comment.
"""

# Alternatively, you can use the hash symbol (#) at the beginning of each line:
# This is another way to create
# a multi-line comment in Python.

Both approaches achieve the same result of commenting out multiple lines.

Details

Leave a Reply

Your email address will not be published. Required fields are marked *