How to place a descriptive comment heading on the top of every .py file in your project with the file name and date, your name, the course number, a description of that file's purpose, and a citation of any sources you used to help write your program.
How to place a descriptive comment heading on the top of every .py file in your project with the file name and
date, your name, the course number, a description of that file's purpose, and a citation of any sources
you used to help write your
Comments in Python :
In every programming language, we have 2 types of comments :-
- Single line Comments
- Multi line Comments
In Python, single line comments start with the hash symbol '#', while multi-line comments are enclosed in triple quotes `'''` or `"""`.
Here's an example of a single line Comment :
# This is a single-line comment
Example of Multi-line comment :
'''
This is a
multi-line
comment
'''
We can also use triple double quotes instead of triple single-quotes :
"""
This is a
multi-line
comment
"""
Multi-line comments are often used to provide more detailed explanations of code,while single-line comments are useful for annotating specific lines or sections of code.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images