Python Comments


Python comments are

Extra Information in code.
They start with # symbol.
They are ignored during code execution.
Useful for explaining code functionality and purpose.

There are three ways we can use python comments. which can be called as python comments best practices

1. Single Line Comment:
   

# This is a single line comment

2. Multi-Line Comment (using multiple single-line comments):

# This is a multi-line
# comment using multiple
# single-line comments

3. Multi-Line Comment (using triple quotes):

'''
This is a multi-line
comment using triple quotes with single quotation mark
'''

"""
This is a multi-line
comment using triple quotes with double quotation mark
"""

4. Inline Comment:

x = 5  # This is an inline comment


Note - If you run those programs, wont retrun anything.