We've moved! — MindVault360 is now SrcForge. Better design, more content & premium notes.

Visit SrcForge →

MindVault360 has moved!

We've upgraded to SrcForge — a faster, more professional platform with better content, premium notes, and a modern design.

Visit us at SrcForge

Thursday, September 19, 2024

Comments


Comments are used to make the program more readable

Creating a comment

We can create a comment using "#" in python

For example: 

#This is a Comment

print("Welcome to SelfLearn")


These comments are ignored by the compiler and will not interpret.

When it comes to Multi-line comment, Python doesn't support any specific multiline comments but however, you can use the """triple quotes""" , as these strings are not assigned to any variable python interpreter will read the code and ignore the sentence inside the quotes as they haven't assigned to any specific variable.


Here is an example for that:

#This is a Comment

print("Welcome to SelfLearn")


""" Python doesn't
have any specific
syntax for
Multiline comments. but you can use this"""

print("Programming in python")


← Back Next →

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home