Python Comments

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

Multiline Comment

There is nothing like multiline comment in Python but we can give it using multiple # symbol and with three double quotes.

Example

OUTPUT:
Hello !!!

Note: Python ignores three time double quotes an same we can use for comment.

Imran Khan

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.

  • Languages: Java, Python
  • Frameworks: J2EE, Spring, Struts 2.0, Hibernate
  • Web Technologies: React, HTML, CSS
  • Analytics: Adobe Analytics
  • Tools & Technologies: IntelliJ, JIRA

🌐 LinkedIn

📝 Blogs

📧 Imran Khan