21CSS101J U4 S4 SLO1 Single Line and Multiline Comments
21CSS101J U4 S4 SLO1 Single Line and Multiline Comments
Problem Solving
U4-S4-SLO-1-Python-Single
and Multi Line Comments
Comments in Python
• Comments are descriptions that help programmers better
understand the intent and functionality of the program.
• They are completely ignored by the Python interpreter.
Advantages of Using Comments
• Using comments in programs makes our code more
understandable. It makes the program more readable
which helps us remember why certain blocks of code
were written.
• Other than that, comments can also be used to ignore
some code while testing other blocks of code. This offers
a simple way to prevent the execution of some lines or
write a quick pseudo-code for the program.
Why are comments beneficial during coding?
• Future Reference - Assume that you have written a program
which contains several hundred lines of code without any
comments. If you open the program after one or two months,
then you will find it challenging to understand your code.