How to Write Comments in Python?

  • Post author:
  • Post comments:0 Comments

Python has become a popular alternative to the complex programming language. Even being 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 optimize 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

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.

Spread the love

Geet

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.
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments