In Python, comments are lines in the code that are not executed by the interpreter. They are used to explain the code, make it more readable, or prevent execution of code while testing. There are two types of comments in Python: single-line comments and multi-line comments.
Single-line comments start with the # symbol. Everything after the # on that line is ignored by the Python interpreter.
#This is a comment
Python does not have a specific syntax for multi-line comments like some other languages. However, you can use a series of single-line comments or use multi-line strings (triple quotes) that are not assigned to a variable.
#This is a comment
#written in
#more than just one line
"""
This is a comment
written in
more than just one line
"""
As long as the string is not assigned to a variable, Python will read the code, but then ignore it, and you have made a multiline comment.