Comments
Comments are parts of your code that are ignored by the computer that runs your program. They are used to help clarify your code and make it more readable and easy to maintain.
To write single line comments in Python, use a
#
.For multi-line comments in Python, use 3 single quotes (
'''
) or 3 double quotes ("""
).# Comments # This is a single line comment ''' This is a multi-line comment ''' """ This is also a multi-line comment """
Practice
Write Comments
Write 3 comments about anything that you want, like your daily routine or your favorite music artist.
Previous Section
1.1 What is Python?Next Section
1.3 Input/OutputCopyright © 2021 Code 4 Tomorrow. All rights reserved.
The code in this course is licensed under the MIT License.
If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.