Utilizor
Contact Us

Python Comments

Adding comments to code.

Examples

Single Line Comment

Comment on its own line.

# This is a comment
print("Hello, World!")

Inline Comment

Comment at the end of a line.

print("Hello, World!") # This is a comment

Multi-line Comment (String Literal)

Using triple quotes for multi-line comments.

"""
This is a comment
written in
more than just one line
"""
print("Hello, World!")

Test Your Knowledge

Python Quiz

No quiz available for this topic yet.