Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn How to Use Comments for Readability | First Acquaintance with Python
Introduction to Python
course content

Course Content

Introduction to Python

Introduction to Python

1. First Acquaintance with Python
2. Variables and Types in Python
3. Conditional Statements in Python
4. Other Data Types in Python
5. Loops in Python
6. Functions in Python

book
How to Use Comments for Readability

As your code grows in size, it can become challenging to understand each part, even if you're the author.

That's why it's essential to get in the habit of leaving comments in your code. Comments help clarify the purpose or function of a specific code segment.

To designate a line as a comment, start it with the # symbol. If you put a # before the print() statement, that line won't run.

12
# print('Message 1') print('Message 2')
copy
How many lines will be displayed when you run the code below?

How many lines will be displayed when you run the code below?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 2
We're sorry to hear that something went wrong. What happened?
some-alt