Python Comments make code more human readable and help others also to understand it better.
Proper use of comment let developer know the code functionality. Comments always ignore by the compiler or interpreter while compiling or interpreting the code. Comment can also be given to code to not to run or execute.
In Python, comment can be provided by using # character symbol.
It can be given anywhere either on top or right side of the line.
Below is the Single Comment example highlighted as black:
OUTPUT:
hello
There is nothing like multiline comment in Python but we can give it using multiple # symbol and with three double quotes.
OUTPUT:
Hello !!!
Note: Python ignores three time double quotes an same we can use for comment.
Specialist Master (Architect) with a passion for cutting-edge technologies like AEM (Adobe Experience Manager) and a proven track record of delivering high-quality software solutions.
📝 Blogs
javadoubts.com © All rights reserved