Comments
Comments are lines that exist in a programs that are ignored by Python. Including comments in programs makes code more readable for humans as it provides some information or explanation about what each part of a program is doing.
In Python, the #
character indicates the start of a comment. Any characters after the #
and up to the end of the line are part of a comment and will be ignored by the Python interpreter.
# this is a comment
message = "Hello, World!" # this is also a comment
Another way to write comments in Python is to use multi-line strings. Python ignores multi-line strings that are not assigned to a variable, so they can be used as comments.
"""
This is a multi-line comment.
Which can span multiple lines.
"""
message = "Hello, World!"