Describing Code

1.12. Describing Code#

Sometimes, it is beneficial to include comments describing your code. Whenever Python encounters the # character, it disregards the remainder of the line.

x * (x + 1) # secret formula

You can have multiline comments by surrounding your comments using triple quotes, either single quotes (') or double quotes (")

"""
This is a multiline comment. 
Test 1234
"""
x * (x + 1)
'''
This is a multiline comment. 
Test 1234
'''
x * (x + 1)