Comments are used to understand the code later or to leave messages in the code.
There are two types of comments:
-
Single-line comment
-
Multi-line comment
file: 11_comments.py
# single-line comment
# This is also a multi-line comment style using multiple #
"""
This is a multi-line string
often used as a multi-line comment
"""Note
Python officially supports single-line comments using
#.
Multi-line comments are usually written using multiple#or triple quotes (""" """).
<< Python Keywords | Python Style Guide >>