Ziad
asked

Expert
Abhay Jajodia answered
Hi iad Keekouri,
Python ignores comments because comments are not for the computer, they are for people.
We use # comments to:
Explain what the code is doing, so it is easier to understand later.
Leave reminders for yourself, especially when you come back to the code after a few days.
Make code easier for others to read if you share it.
Temporarily disable a line without deleting it.
Example:
# This prints the first number
print(6)
# print(8) # This line is disabled for now
print(88.3)
So even though Python does not run comments, they help you write cleaner code and avoid confusion.
If you have more questions, I am here to help 😊
Python
This question was asked as part of the Getting started with Python course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer