It is very convenient to be able to write notes and tips to other developers (or yourself) and include those alongside your code.
There are two types of comments in Python, shown below.
The hash # character can be used to leave a comment:
# this is a comment favorite_fruit = "apple" # another comment
Everything after the # (on the same line) is ignored by Python.
Three double-quote characters put together """ can be used to create a comment that spans multiple lines:
"""This is also a comment and it can span multiple lines """ favorite_fruit = "peach"
Leave a comment