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

bookHow to Use Comments for Readability

As your codebase expands, it can become difficult to grasp every detail, even if you're the one who wrote it. That's why forming the habit of adding comments to your code is crucial. Comments make it easier to understand the purpose or function of specific code segments.

To create a comment, simply begin the line with the # symbol. Any line that starts with # will be ignored by the Python interpreter and won't be executed.

123
# The `print()` statement below won't be executed # print('This is a commented line') print('This text will be printed')
copy
question mark

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

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 2

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

Stel mij vragen over dit onderwerp

Vat dit hoofdstuk samen

Toon voorbeelden uit de praktijk

Awesome!

Completion rate improved to 1.67

bookHow to Use Comments for Readability

Veeg om het menu te tonen

As your codebase expands, it can become difficult to grasp every detail, even if you're the one who wrote it. That's why forming the habit of adding comments to your code is crucial. Comments make it easier to understand the purpose or function of specific code segments.

To create a comment, simply begin the line with the # symbol. Any line that starts with # will be ignored by the Python interpreter and won't be executed.

123
# The `print()` statement below won't be executed # print('This is a commented line') print('This text will be printed')
copy
question mark

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

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 2
some-alt