Comments

Use comments to convey some message or otherwise prevent code from being executed by the interpreter. Comment by using the # sign followed by the commented message:

# This is a single-line comment. It won't be executed.

Unlike other languages, Python doesn't offer multi-line comments, so the best you can do is put a comment on every line:

#
# This is a multi-line comment.
# It won't be executed.
#

Last updated