How to Create a Multiline Comment in Python


In this example we will show how to create a multiline comment using # in Python.

Source Code

# This is the first line of the multiline comment
# This is the second line of the multiline comment
# This is the third line of the multiline comment
print('I love Python!')

Output:

I love Python!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

How to Create a Multiline Comment in Python


In this example we will show how to create a multiline comment using triple quotes in Python.

Source Code

'''
This is the first line of the multiline comment
This is the second line of the multiline comment
This is the third line of the multiline comment
'''
print('I love Python!')

Output:

I love Python!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments