How to Write Comments in Python

You can write comments in Python by following the given code. If you want to learn Python then I will highly recommend you to read This Book.

How to Write Comments in Python
How to Write Comments in Python

Python code can be explained using comments. We can use comments to make the code more readable. Python comments start with the hash #.

#Hello, This is a comment becasue it start with hash sign.
print ("AiHints")

You can also write comments like this.

print ("Artificial Intelligence") #This is also a comment after the hash sign

The main point is the hash sign #.

#print("Hello") You can also comment any line of code
print("Data is new oil")

For Multi-Line comments, You can see This article.

People are also reading:

Best Python Books – Top 10 Python Books

Top 10 Computer Vision Books with Python

What is Computer Vision? Examples, Applications, Techniques

Leave a Comment

Your email address will not be published.