Comments in Python Code

The "#" starts a comment which tells Python to ignore everything after the # on that line.  The "#" can be at the start of a line or after some code.

Examples

Python
# These are comment lines. You use these to explain the purpose
# of the next block of code
Python
print('Hello World!') # A comment after some code.

Notes

This code:

Python
# print('Hello World!')

comments out the code line and therefore it will not execute.

Notes