Categories
Python Answers

How to create multiline comments in Python?

Spread the love

Sometimes, we want to create multiline comments in Python.

In this article, we’ll look at how to create multiline comments in Python.

How to create multiline comments in Python?

To create multiline comments in Python, we can enclose the comment with ''' or create consecutive single line comments.

For instance, we write:

'''
This is a multiline
comment.
'''

to add a multiline comment.

Or, we can add consecutive single line comments with:

# This is a multiline
# comment.

Conclusion

To create multiline comments in Python, we can enclose the comment with ''' or create consecutive single line comments.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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