Sujan S
last year
Sujancountry asked

In Python, why does the program skip a line when it starts with #?

Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Sujan,

Because in Python, # means comment. Anything after # on that line is only a note for humans, so Python ignores it when running the code.

Example:

# this will be skipped
print(34.0)  # this part is also skipped

Only print(34.0) runs.

If you have more questions, I am here to help 😊

Python
This question was asked as part of the Getting started with Python course.