As the following format
# is used for single line commentsExample:
#this line will not execute due to single line commentprint("hello this will execute")
#this line will not execute due to single line comment
print("hello this will execute")
”””””” is used for multiline line commentsExample:
"""This will notexecute due to multiline comments"""'''Also this will notexecute due to multiline comments '''print("hi")
"""This will not
execute due to
multiline comments"""
'''Also this will not
multiline comments '''
print("hi")
There are two ways to comment in the python
#
""" """
We can use Hash and pound symbolExample
# This is single line commentprint("Hello C# Corner") # This is python print function# End of the program
# This is single line comment
print("Hello C# Corner") # This is python print function
# End of the program
We can use triple quotesExample
"""This is multiline comments"""'''This is alsomultiline comments'''
"""
This
is
multiline comments
'''
is also
You can also use comments to define documantation of the program. For that you can use docstring
NoteTo read more about about docstring click on the following link
Python DocString
using hash (#). # this is the comment
Using # symbol you can comment any line in python
using # for single line comment
print(“Hello, python”)
using triple quotes “”” for multiline comment“””This is my multiline comment“””