Comments in Python
In the example, it can be seen that Python Comments are ignored by the interpreter during the execution of the program.
Python3
# sample comment name = "w3wiki" print (name) |
Output:
w3wiki
Python Comments: Importance, Types and Correct Way to Use
Comments in Python are the lines in the code that are ignored by the interpreter during the execution of the program.
# I am single line comment """ Multi-line comment used print("Python Comments") """ |
Comments enhance the readability of the code and help the programmers to understand the code very carefully. It also helps in collaborating with other developers as adding comments makes it easier to explain the code.