How to Write Comments in Python?

Python has become a popular alternative to the complex programming language. Even after being more like a scripting language. It’s very powerful and versatile in nature. Be it any field in the industry you can definitely come across an instance where python would not only reduce your work but optimized it. The best part is, its easy to learn and work with. That is why it is being used in almost every walk of life. Python can be used for:

  • Software Development
  • Web Development
  • Artificial Intelligence
  • Deep Science
  • Data Analysis
  • Machine Learning
  • Automation and Scripting

Moving to the topic. While coding, comments are a part of every program. It helps us as coders or other people associated with the same project you are working on to understand the code flow. So people add comments to make the code more understandable. There are basically 2 ways to write comments in python.

  1. Single Line Comments
  2. Multiline Comments

Single Line Comments

To write single line comments yo need to use #

# this is a single line comment

Multi-line Comment

To use multiline comments you have 
to use the triple quotes

Hope so this article was helpful for you. Please get back to me in case you have any more queries. Till then keep coding !!!!

Subscribe - No background

Get the latest blogs and insights straight to your inbox !

We will keep you updated with the latest tips, tricks, hacks and learning material. Join us and enrich your world with great learning.

5 1 vote
Article Rating
Spread the love

Geet Dhillon

Teacher, Web Designer/Developer by profession and a travel enthusiast who loves to meet people and make new friends. My name is Geet Dhillon and I am inspired by Artists, Writers, Entrepreneur & Visionaries. I try to find way to help, promote their talent and creativity.
Notify of

Inline Feedbacks
View all comments