Lines in your code that Python never runs โ written for humans, to explain intent, leave notes, or switch off code while debugging.
This topic covers how to write comments in Python. Comments are lines in code that are not executed by the Python interpreter โ they exist purely for humans to read, to explain what the code does, add notes, or temporarily disable code.
#).# on that line is ignored by Python.# comments
A bare comment โ just marks that comments are being demonstrated.
# this is a comment
A descriptive single-line comment explaining code or intent.
#
An empty comment (just a # with nothing after it) โ technically valid but has no content.
# (Python does not have a dedicated multi-line comment symbol like /* */ in other languages).# on the same line is not executed.# = start of a comment in Python.In Python, anything after # on a line is a comment and is ignored during execution. Comments help explain code, make it more readable, and can be used to disable a line temporarily while testing. Python only supports single-line comments natively.